@pingid/prettier-plugin-sort-imports weekly downloads statistics
By pingid · npm · Prettier plugins
A tiny Prettier plugin that keeps your import statements tidy.
@pingid/prettier-plugin-sort-imports has 96 recorded weekly downloads on npm, an increase of 700% over the past 30 days, ranking #2633 of 3,247 tracked listings.
About @pingid/prettier-plugin-sort-imports
@pingid/prettier-plugin-sort-imports
A tiny Prettier 3 plugin that keeps your import statements tidy.
- Groups consecutive
import ...lines that are separated by blank lines. - Within every group the lines are reordered by length – the longest import goes on top.
- Side-effect imports (
import 'foo') are pinned to the top of their group in source order, since their order is semantically meaningful.
Installation
pnpm add -D @pingid/prettier-plugin-sort-imports
# or
yarn add -D @pingid/prettier-plugin-sort-imports
# or
npm i -D @pingid/prettier-plugin-sort-imports
Add the plugin to your configuration .prettierrc:
{
"plugins": ["@pingid/prettier-plugin-sort-imports"]
}
Example
// before
import a from 'a'
import { join } from 'node:path'
import b from './b'
import c from './utils/c'
// after — formatted by Prettier
import { join } from 'node:path'
import a from 'a'
import c from './utils/c'
import b from './b'
Side-effect imports
Bare import 'foo' statements are pinned at the top of their group in source order, because reordering them can change runtime behaviour (CSS resets, polyfills, registrations).
// before
import a from 'a'
import 'reset.css'
import { b, c, d } from 'b'
// after
import 'reset.css'
import { b, c, d } from 'b'
import a from 'a'
Option: shiftRelativeImports
Moves relative imports (./ or ../) into a section below absolute imports.
Still sorts by line length within each group and preserves blank lines between original relative-only groups.
Default: false
Prettier config:
{
"plugins": ["@pingid/prettier-plugin-sort-imports"],
"shiftRelativeImports": true
}
Example (simple):
// before
import a from '../relative'
import { b, c } from 'b'
import d from 'c'
import { e, f } from 'd'
import { g, h } from '../relative'
// after
import { b, c } from 'b'
import d from 'c'
import { e, f } from 'd'
import { g, h } from '../relative'
import a from '../relative'
License
This project is licensed under the MIT License.
MIT © Dan Beaven
Description from the npm listing.
- prettier
- prettier-plugin
- imports
- sort
- typescript
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 @pingid/prettier-plugin-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/@pingid/prettier-plugin-sort-imports. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.