Skip to content
PluginStats

prettier-plugin-sort weekly downloads statistics

By xueelf · npm · Prettier plugins

A Prettier plugin for sorting ES module imports, export specifiers, and fields in package.json and tsconfig.json.

View on npm Fresh · Dec 6, 2026

prettier-plugin-sort has 51 recorded weekly downloads on npm, a decrease of 46.9% over the past 30 days, ranking #2771 of 3,247 tracked listings.

Weekly downloads
51
Official API · Dec 5, 2026
7-day growth
+18.6%
+8 weekly downloads
30-day growth
-46.9%
-45 weekly downloads
90-day growth
-40.0%
-34 weekly downloads
Rank
#2771
▼ 126 in 7 days

About prettier-plugin-sort

prettier-plugin-sort

A Prettier plugin focused on sorting code and configuration files.

  • Sort top-level import and export { ... } in JavaScript, TypeScript, and Flow
  • Sort fields in package.json
  • Sort fields in tsconfig.json

Read this in other languages: English | 中文

Preview

Alongside Prettier's regular formatting, the plugin sorts relevant declarations and fields. For example:

<!-- prettier-ignore -->
import App from './App';
import { createRoot } from 'react-dom/client';
import { StrictMode } from 'react';

Are formatted as:

import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './App';

Install

Requires Prettier 3.x, version 3.9 or later.

npm i -D prettier prettier-plugin-sort

Add the plugin to your Prettier config:

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

Continue running Prettier as usual after adding the plugin. Every sorting feature is enabled by default and can be adjusted independently.

Import sorting

Top-level static imports are first gathered at the location of the first import, then grouped and sorted by module source. Named imports inside braces are also sorted by name, with aliased imports using their local names.

Dynamic import() calls and import-like text in strings or comments are left untouched. Set esmImportSort to false to disable all import sorting.

Grouping

esmImportGroups accepts these values:

GroupMatches
builtinModules beginning with node: or bun:, plus bun
externalPackages and module paths not matched by any other group
internalPath aliases from compilerOptions.paths in the TypeScript project containing the current file
parentParent-relative paths such as ../utils
siblingSibling paths such as ./Button
index., ./, ./index, and ./index with an optional extension

Modern Node.js code should reference built-ins explicitly with node: URLs. The plugin also classifies only node:-prefixed modules as builtin. Module specifiers without the prefix, such as fs and path, belong to external.

The table also shows the default order. Duplicate entries are removed automatically, and omitted default groups are appended in their default order.

The plugin searches upward from the current file for the nearest tsconfig.json, then uses files, include, and exclude to select the TypeScript project containing the file, following references when necessary. Each project is resolved through extends before matching the file and reading compilerOptions.paths. Only paths from the selected project are used to classify internal; paths from other referenced projects are not merged. Non-relative paths not declared there remain external. The catch-all pattern * is ignored because it cannot distinguish project modules from third-party packages.

With esmImportSeparation set to false, blank lines are removed both between groups and around side-effect imports.

Type-only import style

esmImportTypeStyle controls how type-only imports are written. It accepts these four values:

ValueInput: import { c, type B, a } from 'mod'
separateimport type { B } from 'mod';<br>import { a, c } from 'mod';
inline-firstimport { type B, a, c } from 'mod';
inline-lastimport { a, c, type B } from 'mod';
mixedimport { a, type B, c } from 'mod';

separate is the default. import type T from 'mod' and import type * as ns from 'mod' keep their original form.

Under verbatimModuleSyntax, import type { T } and import { type T } have different runtime behavior. The plugin converts between them only when the same module also has a value import. Otherwise, it preserves the original form to avoid changing module loading behavior.

Merging

With esmImportMerge enabled, imports from the same module are merged when safe.

Imports are not merged when their import attributes differ, comments cannot move safely, or default and namespace bindings conflict. Side-effect imports always remain separate.

An import with an attached comment keeps its position relative to surrounding declarations from the same module, preserving the merge boundary after sorting.

Export sorting

esmExportSpecifierSort sorts top-level export { ... } and export type { ... } entries by name. Aliased entries use their exported names.

Before sorting:

<!-- prettier-ignore -->
export { useState, useEffect, type FC } from 'react';

After sorting:

export { type FC, useEffect, useState } from 'react';

Export declarations themselves are not moved or merged.

package.json sorting

$schema comes first in package.json. Other fields follow the default rules from sort-package-json 4.0.0. These rules also determine the internal order of scripts and exports.…

Description from the npm listing.

  • imports
  • order
  • organize
  • package.json
  • plugin
  • prettier
  • prettier-plugin
  • sort
  • tsconfig

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-sort weekly downloads on npm, last 90 days: 51 weekly downloads as of Dec 5, 2026, -40.0% over 90 days.prettier-plugin-sortWeekly downloads on npm · Last 90 days51downloads / week-40.0% over 90 days020406080100120140160Sep 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-sort weekly downloads on npm, last 90 days: 51 weekly downloads as of Dec 5, 2026, -40.0% over 90 days.

7/30/90-day growth

prettier-plugin-sort weekly downloads growth on npm: +18.6% over 7 days, -46.9% over 30 days, -40.0% over 90 days.prettier-plugin-sortWeekly downloads growth on npm51downloads / week now7-day growth+8 weekly downloads+18.6%30-day growth-45 weekly downloads-46.9%90-day growth-34 weekly downloads-40.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
prettier-plugin-sort weekly downloads growth on npm: +18.6% over 7 days, -46.9% over 30 days, -40.0% over 90 days.

Ranking history

prettier-plugin-sort npm ranking history: currently #2771 (by weekly downloads).prettier-plugin-sortnpm ranking · by weekly downloads · Last 90 days#2771current rank#1600#1800#2000#2200#2400#2600#2800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
prettier-plugin-sort npm ranking history: currently #2771 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 139, #11 (overall #2,771)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins267 listings · 14 pages · page 6, #13 (overall #113)
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 (170)
Recent weekly downloads observations for prettier-plugin-sort
Date (UTC)Weekly downloadsChange vs. previous
51+23
28+3
250
25+4
21-9
30-12
42-1
430
43+1
42-3
45-4
49-4
53+3
50—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-sort alternatives

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