Extended sort-keys rule with shorthand property support, since ESLint doesn't want to support it natively.
- ESLint 10+
- Node.js 20+
Note: For ESLint 9 support, use v3.x.
npm install eslint-plugin-sort-keys-shorthand --save-devThis plugin uses the ESLint flat config format. Create an eslint.config.js in your project root:
import sortKeysShorthand from 'eslint-plugin-sort-keys-shorthand';
export default [
{
plugins: {
'sort-keys-shorthand': sortKeysShorthand
},
rules: {
'sort-keys-shorthand/sort-keys-shorthand': [
'error',
'asc',
{
caseSensitive: true,
minKeys: 2,
natural: false,
shorthand: 'first'
}
]
}
}
];- sort-keys-shorthand/sort-keys-shorthand: extended rule with shorthand support
Pushing a v* tag triggers the release workflow, which runs tests, publishes to npm with provenance, and creates a GitHub Release.