eslint-plugin-svelte-sort-attributes
v1.3.0
Published
> DISCLAIMER > > All credits to @azat-io, as this code is a modification from his > implementation of `eslint-plugin-perfectionist` > > Svelte property sorting was discontinued after v4 of `eslint-plugin-import` > and a solution inside `eslint-plugin-svel
Readme
eslint-plugin-svelte-sort-attributes
DISCLAIMER
All credits to @azat-io, as this code is a modification from his implementation of
eslint-plugin-perfectionistSvelte property sorting was discontinued after v4 of
eslint-plugin-importand a solution insideeslint-plugin-sveltedoes not fulfill my needs aseslint-plugin-perfectionistdid
Installation
With your package manager:
bun add -d eslint-plugin-svelte-sort-attributes
In your flat eslint config:
import svelteSortAttributes from 'eslint-plugin-svelte-sort-attributes';
export default [
{
plugins: { 'svelte-sort-attributes': svelteSortAttributes },
rules: {
'svelte-sort-attributes/sort-attributes': [
'error',
{ type: 'natural', order: 'asc' }
],
},
},
]In your legacy eslint config:
module.exports = {
plugins: [ 'svelte-sort-attributes' ],
rules: {
'svelte-sort-attributes/sort-attributes': [
'error',
{ type: 'natural', order: 'asc' }
]
}
}