76 lines
2.0 KiB
JavaScript
76 lines
2.0 KiB
JavaScript
const { defineConfig } = require('eslint-define-config')
|
|
|
|
module.exports = defineConfig({
|
|
root: true,
|
|
extends: [
|
|
'eslint:recommended',
|
|
'plugin:n/recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'prettier',
|
|
],
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 2021,
|
|
},
|
|
plugins: ['@typescript-eslint', 'import-x'],
|
|
globals: {
|
|
fetch: false,
|
|
Response: false,
|
|
Request: false,
|
|
addEventListener: false,
|
|
},
|
|
rules: {
|
|
curly: ['error', 'all'],
|
|
quotes: ['error', 'single'],
|
|
semi: ['error', 'never'],
|
|
'no-debugger': ['error'],
|
|
'no-empty': ['warn', { allowEmptyCatch: true }],
|
|
'no-process-exit': 'off',
|
|
'no-useless-escape': 'off',
|
|
'prefer-const': [
|
|
'warn',
|
|
{
|
|
destructuring: 'all',
|
|
},
|
|
],
|
|
'sort-imports': [
|
|
'error',
|
|
{
|
|
ignoreCase: false,
|
|
ignoreDeclarationSort: true,
|
|
ignoreMemberSort: false,
|
|
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
},
|
|
],
|
|
|
|
'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
'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',
|
|
|
|
'@typescript-eslint/ban-types': [
|
|
'error',
|
|
{
|
|
types: {
|
|
Function: false,
|
|
'{}': false,
|
|
},
|
|
},
|
|
],
|
|
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
|
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-inferrable-types': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
'@typescript-eslint/no-var-requires': 'off',
|
|
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
|
|
},
|
|
ignorePatterns: ['dist'],
|
|
})
|