refactor: 重新组织 ESLint 插件配置,添加区域注释以提高可读性
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m37s
/ lint-build-and-check (push) Successful in 4m35s
/ surge (push) Successful in 2m48s
/ playwright (push) Failing after 12m51s

This commit is contained in:
严浩
2025-04-02 11:31:45 +08:00
parent 2bc762a89b
commit 1fecb5cb92

View File

@ -53,6 +53,7 @@ export default defineConfigWithVueTs(
...oxlint.configs['flat/recommended'],
skipFormatting,
// region >> eslint-plugin-unicorn >>
eslintPluginUnicorn.configs.recommended,
{
rules: {
@ -63,7 +64,9 @@ export default defineConfigWithVueTs(
'unicorn/prevent-abbreviations': 'off',
},
},
// endregion <<< eslint-plugin-unicorn <<<
// region >>> eslint-plugin-import-x >>>
eslintPluginImportX.flatConfigs.recommended,
{
rules: {
@ -72,6 +75,19 @@ export default defineConfigWithVueTs(
'import-x/first': 'error',
},
},
// endregion <<< eslint-plugin-import-x <<<
// region >>> eslint-plugin-perfectionist >>>
// https://perfectionist.dev/guide/getting-started
perfectionist.configs['recommended-natural'],
{
rules: {
'perfectionist/sort-classes': 'off',
'perfectionist/sort-objects': 'off',
'perfectionist/sort-imports': ['error'],
},
},
// endregion <<< eslint-plugin-perfectionist <<<
{
rules: {
@ -91,16 +107,4 @@ export default defineConfigWithVueTs(
'vue/multi-word-component-names': 'off',
},
},
// https://perfectionist.dev/guide/getting-started
[
perfectionist.configs['recommended-natural'],
{
rules: {
'perfectionist/sort-classes': 'off',
'perfectionist/sort-objects': 'off',
'perfectionist/sort-imports': ['error'],
},
},
],
);