4.0.0 • Published 8 months ago

eslint-plugin-sort v4.0.0

Weekly downloads
142
License
ISC
Repository
github
Last release
8 months ago

eslint-plugin-sort

Build status npm semantic-release

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: {
      // Customize rules...
    },
  },
]

Legacy config (.eslintrc)

{
  "extends": "plugin:sort/recommended",
  "plugins": ["sort"]
}

List of Supported Rules

āœ”: Enabled in the recommended configuration.\ šŸ”§: Fixable with eslint --fix.

āœ”šŸ”§RuleDescription
āœ”šŸ”§sort/destructuring-propertiesSorts object destructuring properties
āœ”šŸ”§sort/exportsSorts exports
āœ”šŸ”§sort/export-membersSorts export members
āœ”šŸ”§sort/importsSorts imports
āœ”šŸ”§sort/import-membersSorts import members
āœ”šŸ”§sort/object-propertiesSorts object properties
šŸ”§sort/type-propertiesSorts TypeScript type properties
šŸ”§sort/string-enumsSorts TypeScript string enums
šŸ”§sort/string-unionsSorts TypeScript string unions
3.1.1

8 months ago

4.0.0

8 months ago

3.1.0

8 months ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.12.0

1 year ago

2.11.0

2 years ago

2.10.0

2 years ago

2.9.0

2 years ago

2.8.0

2 years ago

2.5.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.7.1

2 years ago

2.3.0

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.4.0

3 years ago

2.3.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.5.0

5 years ago

1.2.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago