|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +import eslint from '@eslint/js'; |
| 4 | +import tseslint from 'typescript-eslint'; |
| 5 | +import globals from 'globals'; |
| 6 | + |
| 7 | +export default tseslint.config( |
| 8 | + eslint.configs.recommended, |
| 9 | + ...tseslint.configs.recommended, |
| 10 | + { |
| 11 | + languageOptions: { |
| 12 | + ecmaVersion: 'latest', |
| 13 | + globals: { |
| 14 | + ...globals.node, |
| 15 | + Atomics: 'readonly', |
| 16 | + SharedArrayBuffer: 'readonly', |
| 17 | + }, |
| 18 | + parserOptions: { |
| 19 | + project: 'tsconfig.json', |
| 20 | + sourceType: 'module', |
| 21 | + ecmaVersion: 'latest', |
| 22 | + }, |
| 23 | + }, |
| 24 | + rules: { |
| 25 | + '@typescript-eslint/adjacent-overload-signatures': 'error', |
| 26 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 27 | + '@typescript-eslint/no-empty-function': 'error', |
| 28 | + '@typescript-eslint/no-empty-interface': 'off', |
| 29 | + '@typescript-eslint/no-explicit-any': [ |
| 30 | + 'off', |
| 31 | + { |
| 32 | + ignoreRestArgs: true, |
| 33 | + }, |
| 34 | + ], |
| 35 | + '@typescript-eslint/no-namespace': 'error', |
| 36 | + '@typescript-eslint/no-unused-vars': [ |
| 37 | + 'warn', |
| 38 | + { |
| 39 | + vars: 'all', |
| 40 | + args: 'none', |
| 41 | + }, |
| 42 | + ], |
| 43 | + '@typescript-eslint/prefer-for-of': 'warn', |
| 44 | + '@typescript-eslint/triple-slash-reference': 'error', |
| 45 | + '@typescript-eslint/unified-signatures': 'warn', |
| 46 | + 'comma-dangle': [ |
| 47 | + 'error', |
| 48 | + { |
| 49 | + arrays: 'always-multiline', |
| 50 | + objects: 'always-multiline', |
| 51 | + imports: 'always-multiline', |
| 52 | + exports: 'always-multiline', |
| 53 | + }, |
| 54 | + ], |
| 55 | + 'constructor-super': 'error', |
| 56 | + eqeqeq: ['warn', 'always'], |
| 57 | + 'for-direction': 'error', |
| 58 | + 'getter-return': 'error', |
| 59 | + 'max-len': [ |
| 60 | + 'warn', |
| 61 | + { |
| 62 | + code: 120, |
| 63 | + tabWidth: 2, |
| 64 | + ignoreStrings: true, |
| 65 | + ignoreTemplateLiterals: true, |
| 66 | + ignoreComments: true, |
| 67 | + }, |
| 68 | + ], |
| 69 | + 'no-await-in-loop': 'off', |
| 70 | + 'no-continue': 'off', |
| 71 | + 'no-async-promise-executor': 'error', |
| 72 | + 'no-case-declarations': 'error', |
| 73 | + 'no-class-assign': 'error', |
| 74 | + 'no-compare-neg-zero': 'error', |
| 75 | + 'no-cond-assign': 'error', |
| 76 | + 'no-const-assign': 'error', |
| 77 | + 'no-constant-condition': 'error', |
| 78 | + 'no-control-regex': 'error', |
| 79 | + 'no-debugger': 'error', |
| 80 | + 'no-delete-var': 'error', |
| 81 | + 'no-dupe-args': 'error', |
| 82 | + 'no-dupe-class-members': 'error', |
| 83 | + 'no-dupe-else-if': 'error', |
| 84 | + 'no-dupe-keys': 'error', |
| 85 | + 'no-duplicate-case': 'error', |
| 86 | + 'no-duplicate-imports': 'error', |
| 87 | + 'no-empty': [ |
| 88 | + 'error', |
| 89 | + { |
| 90 | + allowEmptyCatch: true, |
| 91 | + }, |
| 92 | + ], |
| 93 | + 'no-empty-character-class': 'error', |
| 94 | + 'no-empty-pattern': 'error', |
| 95 | + 'no-ex-assign': 'error', |
| 96 | + 'no-extra-boolean-cast': 'error', |
| 97 | + 'no-extra-semi': 'error', |
| 98 | + 'no-fallthrough': 'error', |
| 99 | + 'no-func-assign': 'error', |
| 100 | + 'no-global-assign': 'error', |
| 101 | + 'no-import-assign': 'error', |
| 102 | + 'no-inner-declarations': 'error', |
| 103 | + 'no-invalid-regexp': 'error', |
| 104 | + 'no-invalid-this': 'error', |
| 105 | + 'no-irregular-whitespace': 'error', |
| 106 | + 'no-misleading-character-class': 'error', |
| 107 | + 'no-mixed-spaces-and-tabs': 'error', |
| 108 | + 'no-new-symbol': 'error', |
| 109 | + 'no-new-wrappers': 'error', |
| 110 | + 'no-obj-calls': 'error', |
| 111 | + 'no-octal': 'error', |
| 112 | + 'no-param-reassign': 'error', |
| 113 | + 'no-plusplus': [ |
| 114 | + 'error', |
| 115 | + { |
| 116 | + allowForLoopAfterthoughts: true, |
| 117 | + }, |
| 118 | + ], |
| 119 | + 'no-prototype-builtins': 'error', |
| 120 | + 'no-redeclare': 'error', |
| 121 | + 'no-regex-spaces': 'error', |
| 122 | + 'no-restricted-syntax': ['off', 'ForOfStatement'], |
| 123 | + 'no-self-assign': 'error', |
| 124 | + 'no-sequences': 'error', |
| 125 | + 'no-setter-return': 'error', |
| 126 | + 'no-shadow': 'off', |
| 127 | + '@typescript-eslint/no-shadow': 'warn', |
| 128 | + 'no-shadow-restricted-names': 'error', |
| 129 | + 'no-sparse-arrays': 'error', |
| 130 | + 'no-this-before-super': 'error', |
| 131 | + 'no-throw-literal': 'error', |
| 132 | + 'no-undef': 'error', |
| 133 | + 'no-underscore-dangle': [ |
| 134 | + 'error', |
| 135 | + { |
| 136 | + allowAfterThis: true, |
| 137 | + }, |
| 138 | + ], |
| 139 | + 'no-unexpected-multiline': 'error', |
| 140 | + 'no-unreachable': 'error', |
| 141 | + 'no-unsafe-finally': 'error', |
| 142 | + 'no-unsafe-negation': 'error', |
| 143 | + 'no-unused-labels': 'error', |
| 144 | + 'no-unused-vars': 'warn', |
| 145 | + 'no-useless-catch': 'error', |
| 146 | + 'no-useless-escape': 'error', |
| 147 | + 'no-var': 'warn', |
| 148 | + 'no-void': 'error', |
| 149 | + 'no-with': 'error', |
| 150 | + 'object-curly-spacing': ['warn', 'always'], |
| 151 | + 'prefer-const': 'warn', |
| 152 | + 'require-yield': 'error', |
| 153 | + 'use-isnan': 'error', |
| 154 | + 'valid-typeof': 'error', |
| 155 | + 'guard-for-in': 'error', |
| 156 | + }, |
| 157 | + } |
| 158 | +); |
0 commit comments