# trivago/prettier-plugin-sort-imports

A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order.

Repository: https://github.com/trivago/prettier-plugin-sort-imports
Canonical: https://ross.abutalabs.com/products/prettier-plugin-sort-imports
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: prettier, prettierrc, typescript, import, sort, plugin, javascript, opensource, hacktoberfest
Last push: 2026-01-07T08:13:11+00:00

## Health v2 (maintenance only)
Score: 70/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 61, release rhythm 65, longevity 100
- inputs: {"age_days": 2235, "days_push": 238, "days_rel": 238, "gap_med": 14.0, "n_releases_24m": 9}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3948, forks 162 (observed 2026-08-28T04:08:30.329968+00:00)

## What it is
A Prettier plugin that sorts import declarations in TypeScript and JavaScript files according to a user-defined regular expression order. It is configured via the prettier config file with options like importOrder, importOrderSeparation, and importOrderSortSpecifiers.

## Use cases
- sort imports in typescript files
- organize javascript import statements by custom order
- enforce consistent import ordering across a codebase
- group third-party and local imports with prettier
- sort import specifiers alphabetically
- auto-format import order in vue sfc files

## When to choose
- you already use Prettier and want deterministic, regex-configurable import ordering
- you want to group imports by path aliases like @core, @server, @ui
- you need to sort named specifiers within import statements

## When to avoid
- you don't use Prettier and only want import sorting
- you need ESLint-based import linting with autofix rather than formatting
- you need sorting of exports or other syntax beyond imports

## Facets
- artifact type: plugin
- maturity: active
- function: formatter, developer-tools
- domain: developer-tools, web-development, frontend
- platform: cross-platform
- tags: prettier, import-sorting, typescript, javascript, code-style, nodejs

## Member repositories
- trivago/prettier-plugin-sort-imports (main) score 70

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:30.329968+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:24:33.870535+00:00, confidence not recorded.
  - readme: https://github.com/trivago/prettier-plugin-sort-imports (fetched 2026-08-28T04:08:30.329968+00:00, sha f9322222714f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
