|
| 1 | +const { defineConfig } = require('eslint-define-config') |
| 2 | + |
| 3 | +module.exports = defineConfig({ |
| 4 | + root: true, |
| 5 | + extends: [ |
| 6 | + 'eslint:recommended', |
| 7 | + 'plugin:node/recommended', |
| 8 | + 'plugin:@typescript-eslint/recommended', |
| 9 | + 'prettier', |
| 10 | + ], |
| 11 | + parser: '@typescript-eslint/parser', |
| 12 | + parserOptions: { |
| 13 | + sourceType: 'module', |
| 14 | + ecmaVersion: 2021, |
| 15 | + }, |
| 16 | + plugins: ['@typescript-eslint', 'import'], |
| 17 | + globals: { |
| 18 | + fetch: false, |
| 19 | + Response: false, |
| 20 | + Request: false, |
| 21 | + addEventListener: false, |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + quotes: ['error', 'single'], |
| 25 | + semi: ['error', 'never'], |
| 26 | + 'no-debugger': ['error'], |
| 27 | + 'no-empty': ['warn', { allowEmptyCatch: true }], |
| 28 | + 'no-process-exit': 'off', |
| 29 | + 'no-useless-escape': 'off', |
| 30 | + 'prefer-const': [ |
| 31 | + 'warn', |
| 32 | + { |
| 33 | + destructuring: 'all', |
| 34 | + }, |
| 35 | + ], |
| 36 | + '@typescript-eslint/ban-types': [ |
| 37 | + 'error', |
| 38 | + { |
| 39 | + types: { |
| 40 | + Function: false, |
| 41 | + }, |
| 42 | + }, |
| 43 | + ], |
| 44 | + 'sort-imports': 0, |
| 45 | + 'import/order': [2, { alphabetize: { order: 'asc' } }], |
| 46 | + |
| 47 | + 'node/no-missing-import': 'off', |
| 48 | + 'node/no-missing-require': 'off', |
| 49 | + 'node/no-deprecated-api': 'off', |
| 50 | + 'node/no-unpublished-import': 'off', |
| 51 | + 'node/no-unpublished-require': 'off', |
| 52 | + 'node/no-unsupported-features/es-syntax': 'off', |
| 53 | + |
| 54 | + '@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }], |
| 55 | + '@typescript-eslint/no-empty-interface': 'off', |
| 56 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 57 | + '@typescript-eslint/no-var-requires': 'off', |
| 58 | + '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }], |
| 59 | + }, |
| 60 | +}) |
0 commit comments