Update rules
This commit is contained in:
@ -1,12 +1,32 @@
|
||||
import { error, off, warn } from '../constants';
|
||||
import type { TypeScriptRulesObject } from '@aet/eslint-define-config/src/rules/typescript-eslint';
|
||||
import type { ImportXRulesObject } from '@aet/eslint-define-config/src/rules/import-x';
|
||||
import type { TypeScriptRulesObject } from '@aet/eslint-define-config/src/rules/typescript-eslint';
|
||||
|
||||
import { error, off, warn } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const importRules: Partial<ImportXRulesObject> = {
|
||||
'import-x/export': off,
|
||||
'import-x/first': error,
|
||||
'import-x/no-absolute-path': error,
|
||||
'import-x/no-duplicates': error,
|
||||
'import-x/order': [error, { groups: ['builtin', 'external'] }],
|
||||
'import-x/no-useless-path-segments': error,
|
||||
'import-x/order': [
|
||||
error,
|
||||
{
|
||||
groups: [
|
||||
'builtin',
|
||||
'external',
|
||||
'internal',
|
||||
'parent',
|
||||
'sibling',
|
||||
'index',
|
||||
'object',
|
||||
'type',
|
||||
],
|
||||
'newlines-between': 'always-and-inside-groups',
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
},
|
||||
],
|
||||
'import-x/unambiguous': error,
|
||||
};
|
||||
|
||||
const typescriptRules: Partial<TypeScriptRulesObject> = {
|
||||
@ -66,8 +86,8 @@ export const importTypeScript = defineMiddleware((config, { addRules, addSetting
|
||||
files: ['.eslintrc.js', '.eslintrc.cjs', '*.config.js', 'index.js'],
|
||||
extends: ['plugin:@typescript-eslint/disable-type-checked'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-require-imports': off,
|
||||
'import-x/no-commonjs': off,
|
||||
'@typescript-eslint/no-require-imports': off,
|
||||
'rules/restrict-template-expressions': off,
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user