eslint-plugin-sort
Auto-fixable sort rules for ESLint.
Installation
npm
npm install -D eslint-plugin-sort
Yarn
yarn add -D eslint-plugin-sort
pnpm
pnpm add -D eslint-plugin-sort
bun
bun add -d eslint-plugin-sort
Usage
After installing, add sort
to your list of ESLint plugins and extend the
recommended configuration. This will enable all available rules as warnings.
Flat config
(eslint.config.js)
import sort from "eslint-plugin-sort"
export default [
sort.configs["flat/recommended"],
{
rules: {
},
},
]
Legacy config
(.eslintrc)
{
"extends": "plugin:sort/recommended",
"plugins": ["sort"]
}
List of Supported Rules
✔: Enabled in the recommended
configuration.
🔧: Fixable with eslint --fix
.