awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
trivago avatar

trivago/prettier-plugin-sort-imports

0
View on GitHub↗
3,944 stars·162 forks·TypeScript·Apache-2.0·10 views

Prettier Plugin Sort Imports

This project is a Prettier plugin designed to alphabetize, group, and format module import statements in JavaScript and TypeScript files. It functions as an automated import organizer that ensures consistent declaration order and spacing across a project.

The plugin uses custom regular expression patterns to sequence dependency imports into logical groups, allowing for the separation of internal and external modules. It supports the preservation of side-effect imports and provides the ability to sort individual named members within a single declaration by string length or alphabetization.

Users can configure sorting behavior through case-sensitivity toggles and use comment markers to exclude specific files or statements from being reorganized. The tool also manages visual separation by inserting new lines between defined import groups.

Features

  • Prettier Plugins - Functions as an extension for the Prettier formatter to introduce custom import sorting and formatting rules.
  • Import Grouping - Categorizes import statements into logical blocks by matching declaration strings against custom regular expressions.
  • Automated Import Sorting - Uses a consistent rule set to arrange third party and internal modules automatically.
  • Import Organizers - Automatically sorts and manages JavaScript import statements to maintain a clean project structure.
  • Import Sorters - Provides an automated formatter that sequences dependency imports into groups using regular expressions.
  • Custom Sorting Patterns - Organizes import declarations based on custom regular expression patterns for third-party and builtin modules.
  • TypeScript Import Management - Organizes TypeScript imports into logical groups using regular expressions to improve readability.
  • Regex-Based Grouping - Sequences import statements into specific groups based on user-defined regular expressions.
  • AST-Based Code Manipulation - Implements import rearrangement by modifying the abstract syntax tree before the final code generation phase.
  • Formatting Opt-Out Mechanisms - Allows bypassing the import sorting process for specific files or statements using dedicated comment markers.
  • Import Exclusion Markers - Prevents the reorganization of imports in specific files or lines using dedicated comment markers.
  • Position Preservation - Maintains the original position of side-effect imports while sorting other declarations around them.
  • Declaration Sorting - Enforces alphabetical or length-based ordering of individual named imports within a single declaration block.
  • Specifier Sorting - Sorts individual named members within a single import declaration by string length or alphabetization.
  • JavaScript and TypeScript Formatting - Ensures consistent import declaration order and spacing across TypeScript project files.

Star history

Star history chart for trivago/prettier-plugin-sort-importsStar history chart for trivago/prettier-plugin-sort-imports

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Prettier Plugin Sort Imports

These projects share indexed features with Prettier Plugin Sort Imports. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • pycqa/isortPyCQA avatar

    PyCQA/isort

    6,948View on GitHub↗

    isort is a Python import sorter and code formatter that organizes import statements into alphabetical groups and sections. It functions as both a utility to automatically rearrange imports for a consistent layout and as a linting tool to verify if code follows specific ordering rules. The project provides configurable layout settings for indentation, wrapping modes, and section ordering to ensure compliance with project style guides and PEP 8. It allows for the exclusion of specific lines or files through inline comments and docstrings. The tool integrates into development workflows via IDE

    Pythonauto-formattercleanercli
    View on GitHub↗6,948
  • nicklockwood/swiftformatnicklockwood avatar

    nicklockwood/SwiftFormat

    8,835View on GitHub↗

    SwiftFormat is a tool for the Swift language that functions as a code formatter, linter, and refactoring utility. It automatically applies consistent style rules and visual formatting to source files to ensure a uniform appearance across a project. The project differentiates itself by providing both a command-line interface for batch processing and an Xcode extension for integration directly into the development environment. It includes specialized capabilities for modernizing legacy API usage, simplifying language constructs, and inferring formatting options by analyzing an existing codebase

    Swift
    View on GitHub↗8,835
  • diffplug/spotlessdiffplug avatar

    diffplug/spotless

    5,527View on GitHub↗

    Spotless is a multi-language formatting orchestrator and Gradle plugin that automates code styling across various programming languages within a single build pipeline. It functions as a coordinator for multiple third-party formatters, a code style linting tool, and a system for inserting and updating standardized license headers. The project distinguishes itself through git-integrated style enforcement, using pre-push hooks and git references to apply formatting only to modified files or lines. It supports shared build configurations, allowing formatting rules to be distributed and loaded acr

    Java
    View on GitHub↗5,527
  • tailwindlabs/prettier-plugin-tailwindcsstailwindlabs avatar

    tailwindlabs/prettier-plugin-tailwindcss

    7,010View on GitHub↗

    This project is a Prettier plugin and Tailwind CSS class sorter that automatically organizes utility classes into a consistent and recommended order. It functions as a frontend styling formatter and CSS utility organizer, removing duplicate classes and sorting style attributes across HTML and JavaScript files. The tool ensures consistent markup formatting by ordering utility classes within HTML attributes, template literals, JavaScript expressions, and custom framework props. It integrates with Tailwind CSS configuration files and stylesheets to synchronize sorting behavior with custom theme

    TypeScript
    View on GitHub↗7,010
Compare all 30 related projects→

Frequently asked questions

What does trivago/prettier-plugin-sort-imports do?

This project is a Prettier plugin designed to alphabetize, group, and format module import statements in JavaScript and TypeScript files. It functions as an automated import organizer that ensures consistent declaration order and spacing across a project.

What are the main features of trivago/prettier-plugin-sort-imports?

The main features of trivago/prettier-plugin-sort-imports are: Prettier Plugins, Import Grouping, Automated Import Sorting, Import Organizers, Import Sorters, Custom Sorting Patterns, TypeScript Import Management, Regex-Based Grouping.

Which projects share features with trivago/prettier-plugin-sort-imports?

Projects with overlapping indexed features include: pycqa/isort — isort is a Python import sorter and code formatter that organizes import statements into alphabetical groups and… nicklockwood/swiftformat — SwiftFormat is a tool for the Swift language that functions as a code formatter, linter, and refactoring utility. It… diffplug/spotless — Spotless is a multi-language formatting orchestrator and Gradle plugin that automates code styling across various… tailwindlabs/prettier-plugin-tailwindcss — This project is a Prettier plugin and Tailwind CSS class sorter that automatically organizes utility classes into a… databricks/scala-style-guide. concrete-utopia/utopia — Utopia is a development platform for building React components through a visual interface that synchronizes changes…