fix(eslint-config): add spread to `tseslint.configs.recommended` (#1084)

pull/1085/head
Yusuke Wada 2025-03-29 14:02:45 +09:00 committed by GitHub
parent 9a98e388cc
commit 8e6961ec9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 78 additions and 85 deletions

View File

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