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.
Videos
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
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:
Reddit
reddit.com › r/neovim › sort imports
r/neovim on Reddit: Sort imports
January 9, 2023 -
Is there a way to sort all of my imports in a JS/TS/JSX/TSX/PYTHON file on save?
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
Starred by 3.9K users
Forked by 158 users
Languages TypeScript 81.4% | JavaScript 11.0% | Svelte 4.3% | Vue 3.3%
Yarn
classic.yarnpkg.com › en › package › prettier-plugin-fix-imports
prettier-plugin-fix-imports
Fast, reliable, and secure dependency management.
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
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?
JetBrains
youtrack.jetbrains.com › issue › WEB-50178 › Code-reformat-with-prettier-and-prettier-plugin-organize-imports-deletes-imports-if-Optimize-imports-is-enabled
Code reformat with prettier and prettier-plugin-organize ...
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
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