eslint-plugin-sort-destructure-keys-typescript
v0.0.3
Published
ESLint plugin to sort destructure keys by typescript type order
Downloads
51
Readme
eslint-plugin-sort-destructure-keys-typescript
ESLint plugin rules to sort destructure keys by typescript type order.
This rule requires parserServices
to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser
.
Configuration
pnpm add -D eslint-plugin-sort-destructure-keys-typescript
Add to your eslint.config.js
export default {
files: ["**/*.?([cm])tsx", "**/*.?([cm])ts"],
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"sort-destructure-keys-typescript": sortDestructureKeysPlugin,
},
rules: {
"sort-destructure-keys-typescript/sort-destructure-keys-by-type": "error",
},
};
License
MIT License © 2024-PRESENT Nir Tamir
Thanks
- https://github.com/antfu/eslint-plugin-antfu for starter project
- https://github.com/mthadley/eslint-plugin-sort-destructure-keys - for ordering