ESLint plugin for automatically sorting imports, objects, types, JSX props, and other code structures to enforce consistency.
ESLint Plugin Perfectionist is an ESLint plugin that enforces consistent sorting of code structures like imports, objects, TypeScript types, enums, and JSX props. It automatically organizes code alphabetically, naturally, or by line length to improve readability and maintainability. The plugin provides fixable rules that integrate seamlessly into existing ESLint workflows.
JavaScript and TypeScript developers working on teams who want to enforce consistent code organization across their codebase. It's particularly useful for projects with strict style guides or those aiming for automated code quality enforcement.
Developers choose this plugin because it offers comprehensive, safe, and automatically fixable sorting rules for a wide variety of code structures. Unlike general formatters, it focuses specifically on sorting logic within ESLint's styling domain, providing fine-grained control without affecting code behavior.
☂️ ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
All rules are automatically fixable via ESLint's --fix option, making it safe and easy to apply corrections without manual intervention, as emphasized in the README's key features.
Enforces sorting on imports, exports, objects, classes, interfaces, enums, JSX props, and more, with over 20 specific rules listed, providing comprehensive code organization.
Supports alphabetical, natural, line-length, and custom sorting orders, offering flexibility for different use cases, as shown in the configs and examples.
Provides recommended configs like recommended-natural for quick setup, reducing configuration time and ensuring consistency out of the box.
Requires ESLint v8.45.0 or greater, which may force upgrades in projects using older versions and limit backward compatibility.
With numerous rules and customizable options, setting up and fine-tuning the plugin can be time-consuming, especially for teams with unique sorting needs beyond the recommended configs.
Can conflict with Prettier or other formatters, as noted in the FAQ about the blurry line between formatting and style, requiring careful integration to avoid rule clashes.