prettier-plugin-auto-sort-imports weekly downloads statistics
By crmapache (2 listings) · npm · Prettier plugins
Zero-config Prettier plugin that sorts and groups imports with blank lines between groups. Discovers your tsconfig/jsconfig path aliases automatically - no regex configuration. Works with TypeScript and JavaScript, frontend and backend.
prettier-plugin-auto-sort-imports has 29 recorded weekly downloads on npm, a decrease of 32.6% over the past 30 days, ranking #2906 of 3,247 tracked listings.
About prettier-plugin-auto-sort-imports
prettier-plugin-auto-sort-imports
Sorts and groups your imports, with blank lines between groups, without asking you to write a single regular expression.
It reads your tsconfig.json / jsconfig.json and works out which imports are your own path aliases, which are npm packages, which are Node builtins and which are relative. Install it, and it does the right thing.
Try it in the playground → Paste your own file, pick a preset, and see what this plugin would do to it.
Why another one
The popular plugins make you choose between control and convenience:
| auto-sort-imports | @trivago/…sort-imports | @ianvs/…sort-imports | …organize-imports | |
|---|---|---|---|---|
| Works with zero configuration | Yes | No | No | Yes |
| Requires hand-written regexes | No | Yes | Yes | No |
| Blank lines between groups | Yes | Yes | Yes | No |
| Finds your aliases from tsconfig itself | Yes | No | No | No |
| Groups your monorepo packages | Yes | No | No | No |
| Needs TypeScript installed | No | No | No | Yes |
| Removes unused imports | Opt-in | No | No | Always |
| Prettier 2 and 3 | Both | Both | Both | Both |
With the regex-based plugins, a project using @core, @ui and @server has to declare and maintain something like:
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"]
Here you declare nothing. Those aliases are already in your tsconfig.json, so the plugin uses them.
Install
npm install --save-dev prettier-plugin-auto-sort-imports
Usage
Prettier 3 (plugins must be listed explicitly):
{
"plugins": ["prettier-plugin-auto-sort-imports"]
}
Prettier 2 works with the same config.
That is the whole setup. Everything below is optional.
Live playground
prettier-plugin-sort-imports.vercel.app runs this plugin on a server and formats as you type. Pick one of the nine framework presets, edit the sample or paste your own file, and flip the options to see what each one changes.
Nothing there is a simulation: the page sends your code to the published package and prints what comes back.
Example
Input
import Fuse from 'fuse.js'
import { BlackTransparentMask } from '../../SharedPageMask'
import { ACCORDEON_DATA, TAB_OPTIONS } from './Faq.constants'
import emptySearchResultSadFace from '@assets/svg/empty-search-result.svg'
import Image from 'next/image'
import { BackdropWrap, Backdrop } from '../FrontBackdrop'
import { SearchInput, Tabs, Accordeon, Typography, Box } from '@core'
import debounce from 'lodash/debounce'
import { useMemo, useState } from 'react'
import './styles.scss'
Output
import { useMemo, useState } from 'react'
import Image from 'next/image'
import Fuse from 'fuse.js'
import debounce from 'lodash/debounce'
import { Box, Tabs, Accordeon, Typography, SearchInput } from '@core'
import emptySearchResultSadFace from '@assets/svg/empty-search-result.svg'
import { Backdrop, BackdropWrap } from '../FrontBackdrop'
import { BlackTransparentMask } from '../../SharedPageMask'
import { TAB_OPTIONS, ACCORDEON_DATA } from './Faq.constants'
import './styles.scss'
Groups
Imports are placed into these groups, in this order:
| Group | What lands there |
|---|---|
builtin | Node builtins: node:fs, path, crypto |
library | Unscoped npm packages, plus any package you pinned as a priority |
scoped | Scoped npm packages such as @mui/material |
workspace | Packages from your own monorepo |
alias | Your own path aliases from tsconfig/jsconfig |
relative | ./foo, ../bar |
Within a group, packages are ordered by depth and then alphabetically. Depth is measured from the package name, so @mui/material ranks alongside axios rather than alongside lodash/debounce - a scope is part of the name, not a folder level. Relative paths count every slash, so ../shallow comes before ../../deep.…
Description from the npm listing.
- prettier
- prettier-plugin
- plugin
- sort
- sort-imports
- import-order
- organize-imports
- imports
- formatting
- typescript
- javascript
- react
- next
- vue
- nuxt
- svelte
- nestjs
- node
- monorepo
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Prettier plugins plugins
All 20 prettier-plugin-auto-sort-imports alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-auto-sort-imports. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.
