An ESLint plugin that automatically sorts imports and exports with a simple, opinionated approach.
eslint-plugin-simple-import-sort is an ESLint plugin that automatically sorts import and export statements in JavaScript and TypeScript code. It solves the problem of inconsistent import ordering by providing a simple, autofixable rule that integrates directly into ESLint workflows. The plugin groups imports logically and sorts them alphabetically, ensuring clean and maintainable codebases.
JavaScript and TypeScript developers who use ESLint and want to automate import sorting without configuring complex rules. It's ideal for teams seeking consistent code style with minimal setup.
Developers choose this plugin for its simplicity, reliability, and seamless autofix integration. Unlike more complex alternatives, it offers sensible defaults, handles edge cases like comments and TypeScript, and reduces merge conflicts by being git diff friendly.
Easy autofixable import sorting.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Directly works with `eslint --fix` for automatic sorting, eliminating the need for separate tools and manual effort, as emphasized in the README's example usage.
Preserves comments during sorting and fully handles TypeScript, including type imports and exports, with examples provided in the README's sorting section.
Sorts based on the `from` string to minimize version control noise and reduce merge conflicts, a key feature explained under 'Why sort on from?' in the FAQ.
Offers a single but powerful `groups` option using regex patterns for defining import sections, allowing tailored grouping without complexity, as detailed in the Custom Grouping section.
Intentionally lacks support for CommonJS `require` statements, limiting usability in projects not yet migrated to ES modules, as admitted in the FAQ.
Only provides one option (`groups`) and fixed sorting rules within groups, which may not suffice for teams with complex or non-standard import ordering needs, as noted in the 'Not for everyone' section.
Requires manual comments to group exports, unlike imports which have automatic grouping, adding overhead for maintaining export organization.