|
1 | | -// @ts-check |
2 | 1 | import { defineConfig } from 'eslint/config'; |
| 2 | +import eslint from '@eslint/js'; |
3 | 3 | import tseslint from 'typescript-eslint'; |
| 4 | +import stylistic from '@stylistic/eslint-plugin'; |
4 | 5 |
|
5 | 6 | export default defineConfig( |
6 | | - tseslint.configs.strict, |
7 | | - tseslint.configs.stylistic, |
| 7 | + eslint.configs.recommended, |
| 8 | + tseslint.configs.strictTypeChecked, |
| 9 | + tseslint.configs.stylisticTypeChecked, |
| 10 | + { |
| 11 | + ignores: ["**/*.js", "coverage", "dist", "docs"] |
| 12 | + }, |
8 | 13 | { |
9 | 14 | files: ['**/*.ts'], |
| 15 | + plugins: { |
| 16 | + '@stylistic': stylistic |
| 17 | + }, |
10 | 18 | languageOptions: { |
11 | 19 | ecmaVersion: 2021, |
12 | 20 | sourceType: 'module', |
13 | 21 | globals: { |
14 | 22 | process: true |
15 | 23 | }, |
16 | 24 | parserOptions: { |
17 | | - project: './tsconfig.json', |
18 | | - tsconfigRootDir: import.meta.dirname |
| 25 | + projectService: true |
19 | 26 | } |
20 | 27 | }, |
21 | 28 | rules: { |
22 | 29 | '@typescript-eslint/no-extraneous-class': 'off', |
23 | | - '@typescript-eslint/no-unused-vars': ['error', { 'caughtErrors': 'none' }], |
24 | | - '@typescript-eslint/unified-signatures': ['error', { 'ignoreDifferentlyNamedParameters': true }], |
25 | | - 'array-bracket-spacing': ['warn', 'never'], |
26 | | - 'array-callback-return': 'error', |
27 | | - 'constructor-super': 'error', |
28 | | - 'for-direction': 'error', |
29 | | - 'getter-return': 'error', |
30 | | - 'no-async-promise-executor': 'error', |
31 | | - 'no-class-assign': 'error', |
32 | | - 'no-compare-neg-zero': 'error', |
33 | | - 'no-cond-assign': 'error', |
34 | | - 'no-const-assign': 'error', |
35 | | - 'no-constant-binary-expression': 'error', |
36 | | - 'no-constant-condition': 'error', |
37 | | - 'no-constructor-return': 'error', |
38 | | - 'no-control-regex': 'error', |
39 | | - 'no-debugger': 'error', |
40 | | - 'no-dupe-args': 'error', |
41 | | - 'no-dupe-class-members': 'error', |
42 | | - 'no-dupe-else-if': 'error', |
43 | | - 'no-dupe-keys': 'error', |
44 | | - 'no-duplicate-case': 'error', |
45 | | - 'no-empty-character-class': 'error', |
46 | | - 'no-empty-pattern': 'error', |
47 | | - 'no-ex-assign': 'error', |
48 | | - 'no-fallthrough': 'error', |
49 | | - 'no-func-assign': 'error', |
50 | | - 'no-import-assign': 'error', |
51 | | - 'no-inner-declarations': 'error', |
52 | | - 'no-invalid-regexp': 'error', |
53 | | - 'no-irregular-whitespace': 'error', |
54 | | - 'no-loss-of-precision': 'error', |
55 | | - 'no-misleading-character-class': 'error', |
56 | | - 'no-new-native-nonconstructor': 'error', |
57 | | - 'no-new-symbol': 'error', |
58 | | - 'no-obj-calls': 'error', |
59 | | - 'no-self-assign': 'error', |
60 | | - 'no-self-compare': 'error', |
61 | | - 'no-setter-return': 'error', |
62 | | - 'no-sparse-arrays': 'error', |
63 | | - 'no-template-curly-in-string': 'error', |
64 | | - 'no-this-before-super': 'error', |
65 | | - 'no-undef': 'error', |
66 | | - 'no-unexpected-multiline': 'error', |
67 | | - 'no-unmodified-loop-condition': 'error', |
68 | | - 'no-unreachable': 'error', |
69 | | - 'no-unreachable-loop': 'error', |
70 | | - 'no-unsafe-finally': 'error', |
71 | | - 'no-unsafe-negation': 'error', |
72 | | - 'no-unsafe-optional-chaining': 'error', |
73 | | - 'no-unused-private-class-members': 'error', |
74 | | - 'no-use-before-define': 'error', |
75 | | - 'no-useless-backreference': 'error', |
76 | | - 'require-atomic-updates': 'error', |
77 | | - 'use-isnan': 'error', |
78 | | - 'valid-typeof': 'error', |
| 30 | + |
79 | 31 | 'accessor-pairs': 'error', |
| 32 | + 'array-callback-return': 'error', |
80 | 33 | 'block-scoped-var': 'error', |
81 | 34 | 'consistent-return': 'error', |
82 | 35 | 'curly': 'error', |
83 | 36 | 'default-case-last': 'error', |
84 | | - 'dot-notation': 'error', |
85 | 37 | 'eqeqeq': ['error', 'smart'], |
86 | 38 | 'func-name-matching': 'error', |
87 | | - 'func-style': ['error', 'expression', { 'overrides': { 'namedExports': 'ignore' } }], |
| 39 | + 'func-style': ['error', 'expression', { overrides: { namedExports: 'ignore' } }], |
88 | 40 | 'grouped-accessor-pairs': 'error', |
89 | | - 'id-denylist': 'error', |
90 | | - 'id-match': 'error', |
91 | 41 | 'max-depth': 'error', |
92 | 42 | 'max-nested-callbacks': 'error', |
93 | 43 | 'new-cap': 'error', |
94 | | - 'no-array-constructor': 'error', |
95 | 44 | 'no-caller': 'error', |
96 | | - 'no-delete-var': 'error', |
| 45 | + 'no-constructor-return': 'error', |
97 | 46 | 'no-div-regex': 'error', |
98 | 47 | 'no-else-return': 'error', |
99 | 48 | 'no-empty-static-block': 'error', |
100 | 49 | 'no-eval': 'error', |
101 | 50 | 'no-extend-native': 'error', |
102 | 51 | 'no-extra-bind': 'error', |
103 | | - 'no-extra-boolean-cast': 'error', |
104 | 52 | 'no-extra-label': 'error', |
105 | | - 'no-extra-semi': 'error', |
106 | | - 'no-floating-decimal': 'error', |
107 | | - 'no-global-assign': 'error', |
108 | 53 | 'no-implicit-globals': 'error', |
109 | 54 | 'no-implied-eval': 'error', |
110 | 55 | 'no-iterator': 'error', |
111 | 56 | 'no-label-var': 'error', |
112 | 57 | 'no-labels': 'error', |
113 | 58 | 'no-lone-blocks': 'error', |
114 | 59 | 'no-lonely-if': 'error', |
115 | | - 'no-loop-func': 'error', |
116 | | - 'no-multi-assign': ['error', { 'ignoreNonDeclaration': true }], |
| 60 | + 'no-multi-assign': ['error', { ignoreNonDeclaration: true }], |
117 | 61 | 'no-multi-str': 'error', |
118 | 62 | 'no-negated-condition': 'error', |
119 | 63 | 'no-new': 'error', |
120 | 64 | 'no-new-func': 'error', |
121 | | - 'no-new-object': 'error', |
122 | 65 | 'no-new-wrappers': 'error', |
123 | | - 'no-nonoctal-decimal-escape': 'error', |
124 | | - 'no-octal': 'error', |
| 66 | + 'no-object-constructor': 'error', |
125 | 67 | 'no-octal-escape': 'error', |
126 | 68 | 'no-proto': 'error', |
127 | | - 'no-regex-spaces': 'error', |
128 | | - 'no-restricted-exports': 'error', |
129 | | - 'no-restricted-globals': 'error', |
130 | | - 'no-restricted-imports': 'error', |
131 | | - 'no-restricted-properties': 'error', |
132 | | - 'no-restricted-syntax': 'error', |
133 | 69 | 'no-return-assign': 'error', |
134 | | - 'no-return-await': 'error', |
135 | 70 | 'no-script-url': 'error', |
| 71 | + 'no-self-compare': 'error', |
136 | 72 | 'no-sequences': 'error', |
137 | | - 'no-shadow': 'error', |
138 | 73 | 'no-shadow-restricted-names': 'error', |
139 | | - 'no-throw-literal': 'error', |
| 74 | + 'no-template-curly-in-string': 'error', |
140 | 75 | 'no-undef-init': 'error', |
| 76 | + 'no-unmodified-loop-condition': 'error', |
141 | 77 | 'no-unneeded-ternary': 'error', |
142 | | - 'no-unused-expressions': 'error', |
143 | | - 'no-unused-labels': 'error', |
| 78 | + 'no-unreachable-loop': 'error', |
144 | 79 | 'no-useless-call': 'error', |
145 | | - 'no-useless-catch': 'error', |
146 | 80 | 'no-useless-computed-key': 'error', |
147 | 81 | 'no-useless-concat': 'error', |
148 | | - 'no-useless-escape': 'error', |
149 | 82 | 'no-useless-rename': 'error', |
150 | 83 | 'no-useless-return': 'error', |
151 | 84 | 'no-void': 'error', |
152 | | - 'no-warning-comments': 'warn', |
153 | | - 'no-with': 'error', |
| 85 | + 'no-warning-comments': 'error', |
154 | 86 | 'operator-assignment': 'error', |
155 | | - 'prefer-const': 'error', |
156 | 87 | 'prefer-exponentiation-operator': 'error', |
157 | 88 | 'prefer-numeric-literals': 'error', |
158 | 89 | 'prefer-object-has-own': 'error', |
159 | 90 | 'prefer-object-spread': 'error', |
160 | | - 'prefer-promise-reject-errors': ['error', { 'allowEmptyReject': true }], |
| 91 | + 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }], |
161 | 92 | 'prefer-regex-literals': 'error', |
162 | 93 | 'prefer-rest-params': 'error', |
163 | 94 | 'prefer-spread': 'error', |
164 | 95 | 'radix': 'error', |
165 | | - 'require-await': 'error', |
166 | | - 'require-yield': 'error', |
| 96 | + 'require-atomic-updates': 'error', |
167 | 97 | 'symbol-description': 'error', |
| 98 | + 'unicode-bom': 'error', |
168 | 99 | 'yoda': 'error', |
169 | | - 'arrow-spacing': 'warn', |
170 | | - 'block-spacing': 'warn', |
171 | | - 'comma-dangle': 'warn', |
172 | | - 'comma-spacing': 'warn', |
173 | | - 'comma-style': 'warn', |
174 | | - 'computed-property-spacing': 'warn', |
175 | | - 'dot-location': ['warn', 'property'], |
176 | | - 'eol-last': 'warn', |
177 | | - 'func-call-spacing': 'warn', |
178 | | - 'generator-star-spacing': 'warn', |
179 | | - 'implicit-arrow-linebreak': 'warn', |
180 | | - 'indent': ['warn', 2, { 'ignoreComments': true }], |
181 | | - 'jsx-quotes': 'warn', |
182 | | - 'key-spacing': 'warn', |
183 | | - 'keyword-spacing': 'warn', |
184 | | - 'linebreak-style': 'warn', |
185 | | - 'lines-between-class-members': 'warn', |
186 | | - 'new-parens': 'warn', |
187 | | - 'no-extra-parens': ['warn', 'functions'], |
188 | | - 'no-mixed-spaces-and-tabs': 'warn', |
189 | | - 'no-multi-spaces': ['warn', { 'ignoreEOLComments': true }], |
190 | | - 'no-tabs': 'warn', |
191 | | - 'no-trailing-spaces': 'warn', |
192 | | - 'no-whitespace-before-property': 'warn', |
193 | | - 'nonblock-statement-body-position': 'warn', |
194 | | - 'object-curly-newline': 'warn', |
195 | | - 'object-curly-spacing': ['warn', 'always'], |
196 | | - 'padding-line-between-statements': 'warn', |
197 | | - 'quotes': ['warn', 'single'], |
198 | | - 'rest-spread-spacing': 'warn', |
199 | | - 'semi': 'warn', |
200 | | - 'semi-spacing': 'warn', |
201 | | - 'semi-style': 'warn', |
202 | | - 'space-before-blocks': 'warn', |
203 | | - 'space-in-parens': 'warn', |
204 | | - 'space-infix-ops': 'warn', |
205 | | - 'space-unary-ops': 'warn', |
206 | | - 'switch-colon-spacing': 'warn', |
207 | | - 'template-curly-spacing': 'warn', |
208 | | - 'template-tag-spacing': 'warn', |
209 | | - 'unicode-bom': 'warn', |
210 | | - 'wrap-iife': ['warn', 'any'], |
211 | | - 'yield-star-spacing': 'warn' |
| 100 | + |
| 101 | + '@stylistic/array-bracket-spacing': ['warn', 'never'], |
| 102 | + '@stylistic/arrow-spacing': 'warn', |
| 103 | + '@stylistic/block-spacing': 'warn', |
| 104 | + '@stylistic/comma-dangle': 'warn', |
| 105 | + '@stylistic/comma-spacing': 'warn', |
| 106 | + '@stylistic/comma-style': 'warn', |
| 107 | + '@stylistic/computed-property-spacing': 'warn', |
| 108 | + '@stylistic/dot-location': ['warn', 'property'], |
| 109 | + '@stylistic/eol-last': 'warn', |
| 110 | + '@stylistic/function-call-spacing': 'warn', |
| 111 | + '@stylistic/generator-star-spacing': 'warn', |
| 112 | + '@stylistic/implicit-arrow-linebreak': 'warn', |
| 113 | + '@stylistic/indent': ['warn', 2, { ignoreComments: true }], |
| 114 | + '@stylistic/jsx-quotes': 'warn', |
| 115 | + '@stylistic/key-spacing': 'warn', |
| 116 | + '@stylistic/keyword-spacing': 'warn', |
| 117 | + '@stylistic/linebreak-style': 'warn', |
| 118 | + '@stylistic/lines-between-class-members': 'warn', |
| 119 | + '@stylistic/member-delimiter-style': ['warn', { multiline: { delimiter: 'semi', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false } }], |
| 120 | + '@stylistic/new-parens': 'warn', |
| 121 | + '@stylistic/no-extra-parens': ['warn', 'functions'], |
| 122 | + '@stylistic/no-extra-semi': 'warn', |
| 123 | + '@stylistic/no-floating-decimal': 'warn', |
| 124 | + '@stylistic/no-mixed-spaces-and-tabs': 'warn', |
| 125 | + '@stylistic/no-multi-spaces': ['warn', { ignoreEOLComments: true }], |
| 126 | + '@stylistic/no-tabs': 'warn', |
| 127 | + '@stylistic/no-trailing-spaces': 'warn', |
| 128 | + '@stylistic/no-whitespace-before-property': 'warn', |
| 129 | + '@stylistic/nonblock-statement-body-position': 'warn', |
| 130 | + '@stylistic/object-curly-newline': 'warn', |
| 131 | + '@stylistic/object-curly-spacing': ['warn', 'always'], |
| 132 | + '@stylistic/padding-line-between-statements': 'warn', |
| 133 | + '@stylistic/quotes': ['warn', 'single'], |
| 134 | + '@stylistic/rest-spread-spacing': 'warn', |
| 135 | + '@stylistic/semi': 'warn', |
| 136 | + '@stylistic/semi-spacing': 'warn', |
| 137 | + '@stylistic/semi-style': 'warn', |
| 138 | + '@stylistic/space-before-blocks': 'warn', |
| 139 | + '@stylistic/space-in-parens': 'warn', |
| 140 | + '@stylistic/space-infix-ops': 'warn', |
| 141 | + '@stylistic/space-unary-ops': 'warn', |
| 142 | + '@stylistic/switch-colon-spacing': 'warn', |
| 143 | + '@stylistic/template-curly-spacing': 'warn', |
| 144 | + '@stylistic/template-tag-spacing': 'warn', |
| 145 | + '@stylistic/wrap-iife': ['warn', 'any'], |
| 146 | + '@stylistic/yield-star-spacing': 'warn' |
212 | 147 | } |
213 | 148 | } |
214 | 149 | ); |
0 commit comments