Skip to content
PluginStats

prettier-plugin-sentiment-import-sort weekly downloads statistics

By andrewhathaway · npm · Prettier plugins

Prettier plugin that orders imports by what each binding is (its semantic kind), not by where it lives on disk. Parses each imported file's AST and classifies every binding by its actual export shape.

View on npm Fresh · Dec 6, 2026

prettier-plugin-sentiment-import-sort has 17 recorded weekly downloads on npm, a decrease of 19.0% over the past 30 days, ranking #3021 of 3,247 tracked listings.

Weekly downloads
17
Official API · Dec 5, 2026
7-day growth
-63.8%
-30 weekly downloads
30-day growth
-19.0%
-4 weekly downloads
90-day growth
+41.7%
+5 weekly downloads
Rank
#3021
▼ 395 in 7 days

About prettier-plugin-sentiment-import-sort

prettier-plugin-sentiment-import-sort

A opinionated Prettier plugin that orders imports by what each binding is (its semantic kind), not by where it lives on disk. Path conventions are unreliable across packages; this plugin parses the imported file's AST and classifies every binding by its actual export shape.

Why

Conventional import sorters group imports by package name or path glob. That breaks down whenever the project's path conventions don't perfectly mirror the kind of code being imported — a .../Components/Foo path might export a hook, a .../Hooks/Bar path might export a constant, and so on.

This plugin classifies each binding by AST inspection of the imported source file, so the resulting order reflects what the code actually is.

Install

npm install --save-dev prettier-plugin-sentiment-import-sort

Add to your Prettier config:

{
  "plugins": ["prettier-plugin-sentiment-import-sort"]
}

Requires Prettier 3.

How imports are grouped

Imports are split into up to five blocks, separated by a blank line. Empty blocks are omitted.

  1. External — anything from outside the file's own package whose value isn't a React component. Built-in node modules, third-party packages, and value/type imports from sibling monorepo packages (except components, which go to block 5).
  2. Relative type imports — import type { ... } from relative paths.
  3. Relative functional / data — relative value imports that aren't components, hooks, or presentation-support kinds (helpers, services, error classes, state, registries).
  4. Relative kind sub-groups — a dynamic block: when 3+ relative imports share a single distinct kind (hooks, translations, theme/tokens, constants), they break out into their own visually separated block.
  5. React components — React component imports from anywhere except packages outside the monorepo.

Within each block, imports are sorted in two passes:

  1. Multi-line imports first, ascending by their longest line length (and bindings inside { ... } are sorted by length).
  2. Single-line imports next, ascending by line length.

Per-binding kind detection

For each binding, the plugin parses the imported source file and classifies the export as one of:

KindAST signature
Componentfunction/arrow returning JSX or React.createElement(...); OR annotated : React.FC<...>; OR wrapped in React.forwardRef/React.memo/React.lazy; OR class extends React.Component; OR styled(X)\...``
Hookfunction whose body recursively calls other hooks
Typeexport type / export interface, or import type / inline type modifier
Translation resourceobject literal whose top-level keys match an i18next Resource shape
Theme / token objectobject literal whose keys match CSS-domain tokens (colours, spacing, etc.)
Constants objectas const or primitive-only object literal
Service / Error classclass X { ... } (with Error superclass → errorClass)
Factory / utility functionfunction returning a non-JSX value; not a hook; not a component
Mixed-binding statements

If an import statement bundles bindings of multiple kinds, the entire statement lives in one block. Any-component-wins: if at least one binding is a React component, the whole statement lands in block 5.

Module resolution

  • Sibling monorepo package imports resolve to the original .ts(x) source rather than the package's compiled dist/. Workspace discovery reads pnpm-workspace.yaml, package.json workspaces, or lerna.json.
  • TypeScript path aliases (compilerOptions.paths in tsconfig.json) are resolved against baseUrl, with extends chains merged. Aliased imports that resolve into the importer's own package are treated as relative; ones that land in a sibling package are treated as workspace-scoped.
  • Imports from packages outside the monorepo are treated as opaque — never inspected — and always belong in block 1.
  • Relative imports resolve against the importing file.

Options…

Description from the npm listing.

  • prettier
  • prettier-plugin
  • imports
  • import-order
  • sort-imports
  • ast
  • react
  • 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

prettier-plugin-sentiment-import-sort weekly downloads on npm, last 90 days: 17 weekly downloads as of Dec 5, 2026, +41.7% over 90 days.prettier-plugin-sentiment-import-sortWeekly downloads on npm · Last 90 days17downloads / week+41.7% over 90 days01020304050Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
prettier-plugin-sentiment-import-sort weekly downloads on npm, last 90 days: 17 weekly downloads as of Dec 5, 2026, +41.7% over 90 days.

7/30/90-day growth

prettier-plugin-sentiment-import-sort weekly downloads growth on npm: -63.8% over 7 days, -19.0% over 30 days, +41.7% over 90 days.prettier-plugin-sentiment-import-sortWeekly downloads growth on npm17downloads / week now7-day growth-30 weekly downloads-63.8%30-day growth-4 weekly downloads-19.0%90-day growth+5 weekly downloads+41.7%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-sentiment-import-sort weekly downloads growth on npm: -63.8% over 7 days, -19.0% over 30 days, +41.7% over 90 days.

Ranking history

prettier-plugin-sentiment-import-sort npm ranking history: currently #3021 (by weekly downloads).prettier-plugin-sentiment-import-sortnpm ranking · by weekly downloads · Last 90 days#3021current rank#500#1000#1500#2000#2500#3000#3500Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-sentiment-import-sort npm ranking history: currently #3021 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 152, #3 (overall #3,023)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 10, #8 (overall #188)
Prettier plugins: every listing in weekly downloads order

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 (592)
Recent weekly downloads observations for prettier-plugin-sentiment-import-sort
Date (UTC)Weekly downloadsChange vs. previous
170
17-4
21+1
20-8
28-4
32-9
41-6
470
47+4
43+12
31+8
23+5
18+9
9—

Data 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-sentiment-import-sort. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.