sveltejs / eslint-plugin-svelte

ESLint plugin for Svelte using AST
https://sveltejs.github.io/eslint-plugin-svelte/
MIT License
306 stars 38 forks source link

export DEFAULT_ORDER #817

Open ryoppippi opened 4 months ago

ryoppippi commented 4 months ago

Description

When I configure DEFAULT_ORDER of sort_attributes rule, I'd like to extend the default order config instead of replacing whole config. https://github.com/sveltejs/eslint-plugin-svelte/blob/7ec6c0f1a34a8eba613253ec4bdeb44055f29108/packages/eslint-plugin-svelte/src/rules/sort-attributes.ts#L26

So, I'd like to extend this DEFAULT_ORDER in my config like

import {DEFAULT_ORDER} from 'eslint-plugin-svelte/sort-attributes';

export default {
// ...

'svelte/sort-attributes': ['error', {
 ...DEFAULT_ORDER,
{match: '/foo-.*/', sort: 'ignor'}
},
// ...

}