🌐
DEV Community
dev.to › diballesteros › how-to-quickly-sort-imports-with-prettier-3po7
How to quickly sort imports with Prettier - DEV Community
March 30, 2022 - npm install prettier @trivago/prettier-plugin-sort-imports --save-dev · Now we can go ahead and start configuring our rules. This plugin receives an array of strings.
🌐
Medium
medium.com › @diballesteros › how-to-quickly-sort-imports-with-prettier-14f82b16a956
How to quickly sort imports with Prettier | by Diego Ballesteros (Relatable Code) | Medium
March 30, 2022 - npm install prettier @trivago/prettier-plugin-sort-imports --save-dev · Now we can go ahead and start configuring our rules. This plugin receives an array of strings.
🌐
Prettier
prettier.io › docs › plugins
Plugins · Prettier
Thus, the two print functions – the one from the core and the one from the plugin – call each other while descending down the AST recursively. Here’s a simplified example to give an idea of what a typical implementation of print looks like: import * as prettier from "prettier"; const { group, indent, join, line, softline } = prettier.doc.builders; function print(path, options, print) { const node = path.node; switch (node.type) { case "list": return group([ "(", indent([softline, join(line, path.map(print, "elements"))]), softline, ")", ]); case "pair": return group([ "(", indent([softline, print("left"), line, ".
🌐
GitHub
github.com › IanVS › prettier-plugin-sort-imports
GitHub - IanVS/prettier-plugin-sort-imports: An opinionated but flexible prettier plugin to sort import statements · GitHub
An opinionated but flexible prettier plugin to sort import statements - IanVS/prettier-plugin-sort-imports
Starred by 1.4K users
Forked by 38 users
Languages   TypeScript 90.1% | JavaScript 7.2% | Vue 2.6% | Astro 0.1%
🌐
Gebna
gebna.gg › blog › auto-sort-imports-prettier
Automatically Sort Your Imports Using This Prettier Plugin
June 1, 2025 - { "useTabs": true, "singleQuote": true, "trailingComma": "es5", "printWidth": 100, "htmlWhitespaceSensitivity": "ignore", "plugins": [ "prettier-plugin-svelte", "prettier-plugin-tailwindcss", "@ianvs/prettier-plugin-sort-imports" ], "overrides": [ { "files": "*.svelte", "options": { "parser": "svelte" } } ], "importOrder": ["^@", "<THIRD_PARTY_MODULES>", "", "^\\$(?!lib/)", "", "^\\$lib/", "", "^[.]"] }
🌐
GitHub
github.com › oki07 › prettier-plugin-astro-organize-imports
GitHub - oki07/prettier-plugin-astro-organize-imports: A Prettier plugin for formatting imports in Astro files · GitHub
A plugin that makes Prettier organize your imports (i.
Starred by 46 users
Forked by 2 users
Languages   TypeScript 89.9% | JavaScript 10.1%
🌐
npm
npmjs.com › package › prettier-plugin-organize-imports
prettier-plugin-organize-imports - npm
This is the same as using the "Organize Imports" action in VS Code. ... 🤯 If your editor supports auto-imports, you'll stop thinking about your imports so much that you won't even care about their order anymore. ... This plugin inherits, extends, and then overrides the built-in Prettier parsers for babel, babel-ts, typescript and vue.
      » npm install prettier-plugin-organize-imports
    
Published   Sep 18, 2025
Version   4.3.0
Author   Simon Haenisch
🌐
Norday Tech
norday.tech › posts › 2023 › automatically-sort-import-statements-with-prettier
Automatically sort import statements with Prettier | Norday Tech
July 31, 2023 - They are regular expressions, apart from the <THIRD_PARTY_MODULES>, that’s added by the plugin. A group is created for each import type and the imports are sorted alphabetically within that group. Your project might use different names and patterns. Therefore it’s needed that you tweak this file for your project needs. We also like an empty line between each group of imports. You can enable this by adding the following option to the .prettierrc:
Find elsewhere
🌐
trivago
tech.trivago.com › presenting @trivago/prettier-plugin-sort-imports
Presenting @trivago/prettier-plugin-sort-imports · trivago tech blog
The @trivago/prettier-plugin-sort-imports prettier plugin sorts the import declarations by using prettier.
🌐
GitHub
github.com › trivago › prettier-plugin-sort-imports
GitHub - trivago/prettier-plugin-sort-imports: A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order. · GitHub
A prettier plugin to sort import declarations by provided Regular Expression order.
Starred by 3.9K users
Forked by 158 users
Languages   TypeScript 81.4% | JavaScript 11.0% | Svelte 4.3% | Vue 3.3%
🌐
Reddit
reddit.com › r/vscode › sorting import statements in vs code with prettier
r/vscode on Reddit: Sorting Import statements in VS Code with Prettier
July 25, 2022 -

Here's one of the videos I made that helped many people with automatic sorting import statements in VS Code using Prettier. I hope it helps people around here as well.

Do let me know some feedback 🙂

https://youtu.be/QQWgN0_gUxI

🌐
LinkedIn
linkedin.com › posts › steventey_underrated-prettier-specifically-the-activity-7117191591898869761-yizM
[Video] Prettier plugin: sort and combine duplicate imports | Steven Tey posted on the topic | LinkedIn
Underrated: Prettier. Specifically the "prettier-plugin-organize-import" plugin. Being able to automatically sort and combine duplicate imports is such a superpower for developer productivity.
Published   October 9, 2023
🌐
Medium
medium.com › @python-javascript-php-html-css › optimizing-typescript-imports-configuring-prettier-and-eslint-for-multi-line-format-ec282b65d64e
Optimizing TypeScript Imports: Configuring Prettier and ESLint for Multi-line Format
October 10, 2024 - When the line exceeds the set width (in this case, 80 or 120 characters), Prettier will automatically format the code to make it more readable. By using the prettier-plugin-organize-imports plugin, we ensure that import statements are split ...
🌐
Reddit
reddit.com › r/vuejs › how to automatically sort imports in vs code?
r/vuejs on Reddit: How to automatically sort imports in VS Code?
March 10, 2025 -

Looking at this GitHub comment, it seems like I should be able to add "editor.codeActionsOnSave": { "source.organizeImports": true } to .vscode/settings.json and have it "just work", but in my testing that doesn't work. How do you handle automatic import sorting for .vue files in Visual Studio Code?

🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › issues › 26
Not working with `prettier-plugin-organize-imports` · Issue #26 · tailwindlabs/prettier-plugin-tailwindcss
December 11, 2021 - // merged-prettier-plugin.js const tailwind = require('prettier-plugin-tailwindcss') const organizeImports = require('prettier-plugin-organize-imports') const combinedFormatter = { ...tailwind, parsers: { ...tailwind.parsers, ...Object.keys(organizeImports.parsers).reduce((acc, key) => { acc[key] = { ...tailwind.parsers[key], preprocess(code, options) { return organizeImports.parsers[key].preprocess(code, options) }, } return acc }, {}), }, } module.exports = combinedFormatter
Author   jacobwgillespie