update eslint to disable export sorting,

This commit is contained in:
louiscklaw
2025-06-18 10:54:30 +08:00
parent 779984f65c
commit b80939c78d

View File

@@ -1,3 +1,5 @@
// src/cms_backend/eslint.config.mjs
//
import globals from 'globals'; import globals from 'globals';
import eslintJs from '@eslint/js'; import eslintJs from '@eslint/js';
import eslintTs from 'typescript-eslint'; import eslintTs from 'typescript-eslint';
@@ -69,10 +71,7 @@ const importRules = () => ({
*/ */
const unusedImportsRules = () => ({ const unusedImportsRules = () => ({
'unused-imports/no-unused-imports': 1, 'unused-imports/no-unused-imports': 1,
'unused-imports/no-unused-vars': [ 'unused-imports/no-unused-vars': [0, { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }],
0,
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
}); });
/** /**
@@ -93,15 +92,17 @@ const sortImportsRules = () => {
return { return {
'perfectionist/sort-named-imports': [1, { type: 'line-length', order: 'asc' }], 'perfectionist/sort-named-imports': [1, { type: 'line-length', order: 'asc' }],
'perfectionist/sort-named-exports': [1, { type: 'line-length', order: 'asc' }],
'perfectionist/sort-exports': [ // disable sorting of export, i manage the export ordering
1, // 'perfectionist/sort-named-exports': [1, { type: 'line-length', order: 'asc' }],
{ // 'perfectionist/sort-exports': [
order: 'asc', // 1,
type: 'line-length', // {
groupKind: 'values-first', // order: 'asc',
}, // type: 'line-length',
], // groupKind: 'values-first',
// },
// ],
'perfectionist/sort-imports': [ 'perfectionist/sort-imports': [
2, 2,
{ {