trivago/prettier-plugin-sort-imports

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 40 minutes ago
Type:Plugin / ExtensionCategory(s):Code Quality & Static AnalysisDeveloper Tools
Added to GitGenius on September 17th, 2026
Created on July 20th, 2020
Open Issues & Pull Requests: 94 (+0)
GitHub issues: Enabled
Number of forks: 162
Total Stargazers: 3,951 (+0)
Total Subscribers: 6 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 19.7 days
Mean response time: 79.7 days
90th percentile: 204.6 days
Tracked items: 58

Most active contributors

Sign in to see contributor activity.

How this project is maintained

100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 66% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 45
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 762 days
Stale 30+ days: 40
Stale 90+ days: 39

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • investigation (53)
  • feature request (12)
  • bug (2)
  • help wanted (1)
  • v5 (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Prettier plugin sort imports is a Prettier plugin that sorts import declarations in TypeScript and JavaScript files according to a configurable Regular Expression order.

The plugin addresses the problem of maintaining consistent import organization across codebases by allowing developers to define custom sorting rules through regular expressions. It works by parsing import statements and reordering them based on patterns specified in the configuration, with special handling for built-in Node.js modules and third-party imports. The tool integrates directly into Prettier's formatting pipeline, applying import sorting automatically during code formatting.

Developers should adopt this tool if they want automated, consistent import organization without manual effort or separate linting tools. It suits projects using Prettier that need fine-grained control over import ordering beyond simple alphabetical sorting. The plugin offers several configuration options including import group separation with newlines, sorting of specifiers within imports, namespace specifier grouping, case-insensitive sorting, and length-based sorting. It supports Vue single-file components with appropriate dependencies installed and provides babel parser plugin configuration for handling various syntax variations.

The project maintains active engagement with migration guidance for major version updates, indicating attention to breaking changes and user transitions. Development includes comprehensive configuration documentation covering multiple sorting strategies and edge cases. The tool addresses compatibility concerns with different package managers and Prettier versions through documented workarounds in its configuration guidance.