fix(eslint-config): add spread to `tseslint.configs.recommended` (#1084)
parent
9a98e388cc
commit
8e6961ec9b
|
@ -6,98 +6,91 @@ import tseslint from 'typescript-eslint'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
nodePlugin.configs["flat/recommended"],
|
nodePlugin.configs['flat/recommended'],
|
||||||
tseslint.configs.recommended,
|
...tseslint.configs.recommended,
|
||||||
{
|
{
|
||||||
plugins: {
|
plugins: {
|
||||||
'@typescript-eslint': tseslint.plugin,
|
'@typescript-eslint': tseslint.plugin,
|
||||||
'import-x': importX,
|
'import-x': importX,
|
||||||
},
|
},
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
fetch: false,
|
fetch: false,
|
||||||
Response: false,
|
Response: false,
|
||||||
Request: false,
|
Request: false,
|
||||||
addEventListener: false,
|
addEventListener: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
ecmaVersion: 2021,
|
ecmaVersion: 2021,
|
||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
curly: ['error', 'all'],
|
curly: ['error', 'all'],
|
||||||
quotes: ['error', 'single'],
|
quotes: ['error', 'single'],
|
||||||
semi: ['error', 'never'],
|
semi: ['error', 'never'],
|
||||||
'no-debugger': ['error'],
|
'no-debugger': ['error'],
|
||||||
|
|
||||||
'no-empty': [
|
'no-empty': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
allowEmptyCatch: true,
|
allowEmptyCatch: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
'no-process-exit': 'off',
|
'no-process-exit': 'off',
|
||||||
'no-useless-escape': 'off',
|
'no-useless-escape': 'off',
|
||||||
|
|
||||||
'prefer-const': [
|
'prefer-const': [
|
||||||
'warn',
|
'warn',
|
||||||
{
|
{
|
||||||
destructuring: 'all',
|
destructuring: 'all',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
||||||
'import-x/order': [
|
'import-x/order': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
groups: [
|
groups: ['external', 'builtin', 'internal', 'parent', 'sibling', 'index'],
|
||||||
'external',
|
alphabetize: {
|
||||||
'builtin',
|
order: 'asc',
|
||||||
'internal',
|
caseInsensitive: true,
|
||||||
'parent',
|
},
|
||||||
'sibling',
|
},
|
||||||
'index',
|
],
|
||||||
],
|
'import-x/no-duplicates': 'error',
|
||||||
alphabetize: {
|
|
||||||
order: 'asc',
|
|
||||||
caseInsensitive: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'import-x/no-duplicates': 'error',
|
|
||||||
|
|
||||||
'n/no-missing-import': 'off',
|
'n/no-missing-import': 'off',
|
||||||
'n/no-missing-require': 'off',
|
'n/no-missing-require': 'off',
|
||||||
'n/no-deprecated-api': 'off',
|
'n/no-deprecated-api': 'off',
|
||||||
'n/no-unpublished-import': 'off',
|
'n/no-unpublished-import': 'off',
|
||||||
'n/no-unpublished-require': 'off',
|
'n/no-unpublished-require': 'off',
|
||||||
'n/no-unsupported-features/es-syntax': 'off',
|
'n/no-unsupported-features/es-syntax': 'off',
|
||||||
'n/no-unsupported-features/node-builtins': 'off',
|
'n/no-unsupported-features/node-builtins': 'off',
|
||||||
|
|
||||||
'@typescript-eslint/consistent-type-imports': [
|
'@typescript-eslint/consistent-type-imports': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
prefer: 'type-imports',
|
prefer: 'type-imports',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'@typescript-eslint/no-empty-object-type': 'off',
|
'@typescript-eslint/no-empty-object-type': 'off',
|
||||||
'@typescript-eslint/no-unsafe-function-type': 'off',
|
'@typescript-eslint/no-unsafe-function-type': 'off',
|
||||||
'@typescript-eslint/no-empty-function': [
|
'@typescript-eslint/no-empty-function': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
allow: ['arrowFunctions'],
|
allow: ['arrowFunctions'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'@typescript-eslint/no-unused-expressions': 'off',
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
'@typescript-eslint/no-empty-interface': 'off',
|
'@typescript-eslint/no-empty-interface': 'off',
|
||||||
'@typescript-eslint/no-explicit-any': 'warn',
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
'@typescript-eslint/no-inferrable-types': 'off',
|
'@typescript-eslint/no-inferrable-types': 'off',
|
||||||
'@typescript-eslint/no-require-imports': 'off',
|
'@typescript-eslint/no-require-imports': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': 'warn',
|
'@typescript-eslint/no-unused-vars': 'warn',
|
||||||
'@typescript-eslint/no-var-requires': 'off',
|
'@typescript-eslint/no-var-requires': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
prettier,
|
prettier,
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue