@mikey-pro/eslint-config 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/flat.js +48 -0
- package/index.js +32 -154
- package/overrides.js +200 -196
- package/package.json +57 -40
- package/rules.js +515 -202
package/overrides.js
CHANGED
|
@@ -1,42 +1,72 @@
|
|
|
1
|
+
// Modern overrides for different file types and frameworks
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
|
|
4
|
-
import
|
|
4
|
+
|
|
5
|
+
import html from '@html-eslint/eslint-plugin';
|
|
6
|
+
import htmlParser from '@html-eslint/parser';
|
|
7
|
+
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
8
|
+
import tsParser from '@typescript-eslint/parser';
|
|
9
|
+
import cypress from 'eslint-plugin-cypress';
|
|
5
10
|
import importPlugin from 'eslint-plugin-import';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
11
|
+
import jest from 'eslint-plugin-jest';
|
|
12
|
+
import markdownlint from 'eslint-plugin-markdownlint';
|
|
13
|
+
import jsoncParser from 'jsonc-eslint-parser';
|
|
14
|
+
import tomlParser from 'toml-eslint-parser';
|
|
15
|
+
import yamlParser from 'yaml-eslint-parser';
|
|
8
16
|
|
|
9
|
-
const
|
|
17
|
+
const currentDirectory = import.meta.dirname;
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
// TypeScript configuration
|
|
20
|
+
export const ts = {
|
|
21
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
13
22
|
languageOptions: {
|
|
14
|
-
ecmaFeatures: {
|
|
15
|
-
jsx: true,
|
|
16
|
-
},
|
|
17
23
|
ecmaVersion: 'latest',
|
|
18
|
-
|
|
24
|
+
parser: tsParser,
|
|
25
|
+
parserOptions: {
|
|
26
|
+
ecmaFeatures: { jsx: true },
|
|
27
|
+
extraFileExtensions: ['.vue', '.svelte'],
|
|
28
|
+
project: path.join(currentDirectory, '../../tsconfig.json'),
|
|
29
|
+
tsconfigRootDir: path.join(currentDirectory, '../..'),
|
|
30
|
+
},
|
|
19
31
|
sourceType: 'module',
|
|
20
|
-
project: 'tsconfig.json',
|
|
21
|
-
tsconfigRootDir: path.join(currentDir, '../../..'),
|
|
22
32
|
},
|
|
23
33
|
plugins: {
|
|
24
|
-
'@typescript-eslint':
|
|
34
|
+
'@typescript-eslint': tsPlugin,
|
|
25
35
|
import: importPlugin,
|
|
26
36
|
},
|
|
27
37
|
rules: {
|
|
28
|
-
|
|
29
|
-
...
|
|
38
|
+
// TypeScript-specific rules
|
|
39
|
+
...tsPlugin.configs.all.rules,
|
|
40
|
+
...tsPlugin.configs['recommended-requiring-type-checking'].rules,
|
|
30
41
|
...importPlugin.configs.typescript.rules,
|
|
42
|
+
|
|
43
|
+
// Override some rules for better developer experience
|
|
31
44
|
'@typescript-eslint/class-methods-use-this': 'off',
|
|
45
|
+
'@typescript-eslint/consistent-generic-constructors': [
|
|
46
|
+
'error',
|
|
47
|
+
'constructor',
|
|
48
|
+
],
|
|
49
|
+
'@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
|
|
50
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
51
|
+
'error',
|
|
52
|
+
{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' },
|
|
53
|
+
],
|
|
54
|
+
'@typescript-eslint/consistent-type-exports': [
|
|
55
|
+
'error',
|
|
56
|
+
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
|
57
|
+
],
|
|
32
58
|
'@typescript-eslint/consistent-type-imports': [
|
|
33
59
|
'error',
|
|
34
60
|
{
|
|
35
|
-
prefer: 'type-imports',
|
|
36
|
-
fixStyle: 'separate-type-imports',
|
|
37
61
|
disallowTypeAnnotations: false,
|
|
62
|
+
fixStyle: 'separate-type-imports',
|
|
63
|
+
prefer: 'type-imports',
|
|
38
64
|
},
|
|
39
65
|
],
|
|
66
|
+
'@typescript-eslint/explicit-function-return-type': [
|
|
67
|
+
'warn',
|
|
68
|
+
{ allowExpressions: true, allowTypedFunctionExpressions: true },
|
|
69
|
+
],
|
|
40
70
|
'@typescript-eslint/explicit-member-accessibility': [
|
|
41
71
|
'warn',
|
|
42
72
|
{
|
|
@@ -45,8 +75,8 @@ const ts = {
|
|
|
45
75
|
accessors: 'explicit',
|
|
46
76
|
constructors: 'no-public',
|
|
47
77
|
methods: 'explicit',
|
|
48
|
-
properties: 'off',
|
|
49
78
|
parameterProperties: 'explicit',
|
|
79
|
+
properties: 'off',
|
|
50
80
|
},
|
|
51
81
|
},
|
|
52
82
|
],
|
|
@@ -74,202 +104,182 @@ const ts = {
|
|
|
74
104
|
],
|
|
75
105
|
},
|
|
76
106
|
],
|
|
107
|
+
'@typescript-eslint/method-signature-style': ['error', 'property'],
|
|
77
108
|
'@typescript-eslint/naming-convention': [
|
|
78
109
|
'error',
|
|
110
|
+
{ format: ['PascalCase'], selector: ['typeLike'] },
|
|
111
|
+
{ format: ['PascalCase'], prefix: ['T'], selector: ['typeParameter'] },
|
|
79
112
|
{
|
|
80
|
-
selector: ['typeLike'],
|
|
81
|
-
format: ['PascalCase']
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
selector: ['typeParameter'],
|
|
85
|
-
format: ['PascalCase'],
|
|
86
|
-
prefix: ['T']
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
selector: ['interface'],
|
|
90
|
-
format: ['PascalCase'],
|
|
91
113
|
custom: {
|
|
92
|
-
regex: '^I[A-Z]',
|
|
93
114
|
match: false,
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
115
|
+
regex: '^I[A-Z]',
|
|
116
|
+
},
|
|
117
|
+
format: ['PascalCase'],
|
|
118
|
+
selector: ['interface'],
|
|
119
|
+
},
|
|
97
120
|
],
|
|
121
|
+
'@typescript-eslint/no-confusing-void-expression': [
|
|
122
|
+
'error',
|
|
123
|
+
{ ignoreArrowShorthand: true },
|
|
124
|
+
],
|
|
125
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
98
126
|
'@typescript-eslint/no-extraneous-class': [
|
|
99
127
|
'warn',
|
|
100
128
|
{
|
|
101
|
-
allowEmpty: true,
|
|
102
129
|
allowConstructorOnly: false,
|
|
130
|
+
allowEmpty: true,
|
|
103
131
|
allowStaticOnly: false,
|
|
104
132
|
allowWithDecorator: false,
|
|
105
133
|
},
|
|
106
134
|
],
|
|
107
|
-
'@typescript-eslint/no-inferrable-types': 'off',
|
|
108
|
-
'@typescript-eslint/no-magic-numbers': 'off',
|
|
109
|
-
'@typescript-eslint/no-unnecessary-condition': 'off',
|
|
110
|
-
'@typescript-eslint/parameter-properties': ['error', { prefer: 'parameter-property' }],
|
|
111
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
112
|
-
'@typescript-eslint/prefer-readonly': 'off',
|
|
113
|
-
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
114
|
-
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
115
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
116
|
-
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
|
|
117
|
-
'@typescript-eslint/consistent-type-assertions': [
|
|
118
|
-
'error',
|
|
119
|
-
{
|
|
120
|
-
assertionStyle: 'as',
|
|
121
|
-
objectLiteralTypeAssertions: 'never',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
'@typescript-eslint/explicit-function-return-type': [
|
|
125
|
-
'warn',
|
|
126
|
-
{
|
|
127
|
-
allowExpressions: true,
|
|
128
|
-
allowTypedFunctionExpressions: true,
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
132
135
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
133
136
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
134
137
|
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
138
|
+
'@typescript-eslint/no-inferrable-types': 'off',
|
|
139
|
+
'@typescript-eslint/no-magic-numbers': 'off',
|
|
135
140
|
'@typescript-eslint/no-misused-promises': [
|
|
136
141
|
'error',
|
|
137
|
-
{
|
|
138
|
-
checksVoidReturn: false,
|
|
139
|
-
},
|
|
142
|
+
{ checksVoidReturn: false },
|
|
140
143
|
],
|
|
141
|
-
'@typescript-eslint/no-
|
|
144
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
145
|
+
'@typescript-eslint/no-redundant-type-constituents': 'error',
|
|
142
146
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
147
|
+
'@typescript-eslint/no-unnecessary-condition': 'off',
|
|
143
148
|
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
149
|
+
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
150
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
151
|
+
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
144
152
|
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
145
153
|
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
146
|
-
'@typescript-eslint/
|
|
154
|
+
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
155
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
156
|
+
'@typescript-eslint/parameter-properties': [
|
|
157
|
+
'error',
|
|
158
|
+
{ prefer: 'parameter-property' },
|
|
159
|
+
],
|
|
160
|
+
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
161
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
162
|
+
'@typescript-eslint/prefer-includes': 'error',
|
|
163
|
+
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
164
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
165
|
+
'@typescript-eslint/prefer-optional-chain': [
|
|
166
|
+
'error',
|
|
167
|
+
{
|
|
168
|
+
checkAny: true,
|
|
169
|
+
checkBigInt: true,
|
|
170
|
+
checkBoolean: true,
|
|
171
|
+
checkNumber: true,
|
|
172
|
+
checkString: true,
|
|
173
|
+
checkUnknown: true,
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
'@typescript-eslint/prefer-readonly': 'off',
|
|
177
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
147
178
|
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
|
|
179
|
+
'@typescript-eslint/prefer-regexp-exec': 'error',
|
|
148
180
|
'@typescript-eslint/prefer-return-this-type': 'error',
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'@typescript-eslint/
|
|
152
|
-
'@typescript-eslint/consistent-generic-constructors': ['error', 'constructor'],
|
|
153
|
-
'@typescript-eslint/no-confusing-void-expression': [
|
|
181
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
182
|
+
'@typescript-eslint/prefer-ts-expect-error': 'error',
|
|
183
|
+
'@typescript-eslint/promise-function-async': [
|
|
154
184
|
'error',
|
|
155
|
-
{
|
|
185
|
+
{
|
|
186
|
+
checkArrowFunctions: true,
|
|
187
|
+
checkFunctionDeclarations: true,
|
|
188
|
+
checkFunctionExpressions: true,
|
|
189
|
+
checkMethodDeclarations: true,
|
|
190
|
+
},
|
|
156
191
|
],
|
|
157
|
-
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
158
|
-
'@typescript-eslint/promise-function-async': 'error',
|
|
159
192
|
'@typescript-eslint/require-array-sort-compare': [
|
|
160
193
|
'error',
|
|
161
|
-
{ ignoreStringArrays: true }
|
|
194
|
+
{ ignoreStringArrays: true },
|
|
162
195
|
],
|
|
196
|
+
'@typescript-eslint/sort-type-constituents': 'error',
|
|
163
197
|
'@typescript-eslint/strict-boolean-expressions': [
|
|
164
198
|
'error',
|
|
165
199
|
{
|
|
166
|
-
|
|
200
|
+
allowNullableObject: false,
|
|
167
201
|
allowNumber: false,
|
|
168
|
-
|
|
169
|
-
}
|
|
202
|
+
allowString: false,
|
|
203
|
+
},
|
|
170
204
|
],
|
|
171
|
-
'@typescript-eslint/method-signature-style': ['error', 'property'],
|
|
172
|
-
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
173
|
-
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
174
|
-
'@typescript-eslint/prefer-ts-expect-error': 'error',
|
|
175
|
-
'@typescript-eslint/sort-type-constituents': 'error',
|
|
176
205
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
177
|
-
'@typescript-eslint/
|
|
178
|
-
|
|
179
|
-
checkUnknown: true,
|
|
180
|
-
checkString: true,
|
|
181
|
-
checkNumber: true,
|
|
182
|
-
checkBoolean: true,
|
|
183
|
-
checkBigInt: true
|
|
184
|
-
}],
|
|
185
|
-
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
186
|
-
'@typescript-eslint/no-redundant-type-constituents': 'error',
|
|
187
|
-
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
188
|
-
'@typescript-eslint/no-useless-template-literals': 'error',
|
|
189
|
-
'@typescript-eslint/prefer-find': 'error',
|
|
190
|
-
'@typescript-eslint/consistent-type-exports': [
|
|
191
|
-
'error',
|
|
192
|
-
{ fixMixedExportsWithInlineTypeSpecifier: true }
|
|
193
|
-
],
|
|
194
|
-
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
195
|
-
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
196
|
-
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
197
|
-
'@typescript-eslint/prefer-includes': 'error',
|
|
198
|
-
'@typescript-eslint/prefer-regexp-exec': 'error',
|
|
199
|
-
'@typescript-eslint/promise-function-async': ['error', {
|
|
200
|
-
checkArrowFunctions: true,
|
|
201
|
-
checkFunctionDeclarations: true,
|
|
202
|
-
checkFunctionExpressions: true,
|
|
203
|
-
checkMethodDeclarations: true
|
|
204
|
-
}]
|
|
206
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
207
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
|
|
205
208
|
},
|
|
206
209
|
settings: {
|
|
207
210
|
'import/parsers': {
|
|
208
211
|
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
|
|
209
212
|
},
|
|
210
213
|
'import/resolver': {
|
|
211
|
-
typescript: {
|
|
212
|
-
alwaysTryTypes: true,
|
|
213
|
-
},
|
|
214
|
+
typescript: { alwaysTryTypes: true },
|
|
214
215
|
},
|
|
215
216
|
},
|
|
216
217
|
};
|
|
217
218
|
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
// CSS files
|
|
220
|
+
export const css = {
|
|
221
|
+
files: ['**/*.css'],
|
|
220
222
|
rules: {
|
|
221
223
|
'prettier/prettier': ['warn', { parser: 'css' }],
|
|
222
224
|
},
|
|
223
225
|
};
|
|
224
226
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
+
// SCSS files
|
|
228
|
+
export const scss = {
|
|
229
|
+
files: ['**/*.scss'],
|
|
227
230
|
rules: {
|
|
228
231
|
'prettier/prettier': ['warn', { parser: 'scss' }],
|
|
229
232
|
},
|
|
230
233
|
};
|
|
231
234
|
|
|
232
|
-
|
|
233
|
-
|
|
235
|
+
// Less files
|
|
236
|
+
export const less = {
|
|
237
|
+
files: ['**/*.less'],
|
|
234
238
|
rules: {
|
|
235
239
|
'prettier/prettier': ['warn', { parser: 'less' }],
|
|
236
240
|
},
|
|
237
241
|
};
|
|
238
242
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
files: ['
|
|
242
|
-
|
|
243
|
+
// YAML files
|
|
244
|
+
export const yaml = {
|
|
245
|
+
files: ['**/*.yaml', '**/*.yml'],
|
|
246
|
+
languageOptions: {
|
|
247
|
+
parser: yamlParser,
|
|
248
|
+
},
|
|
243
249
|
rules: {
|
|
244
|
-
'yml/quotes': ['warn', { prefer: 'double', avoidEscape: true }],
|
|
245
250
|
'prettier/prettier': ['warn', { parser: 'yaml', singleQuote: false }],
|
|
251
|
+
'yml/quotes': ['warn', { avoidEscape: true, prefer: 'double' }],
|
|
246
252
|
},
|
|
247
253
|
};
|
|
248
254
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
files: ['
|
|
252
|
-
|
|
255
|
+
// TOML files
|
|
256
|
+
export const toml = {
|
|
257
|
+
files: ['**/*.toml'],
|
|
258
|
+
languageOptions: {
|
|
259
|
+
parser: tomlParser,
|
|
260
|
+
},
|
|
253
261
|
rules: {
|
|
254
262
|
'prettier/prettier': 'off',
|
|
255
263
|
},
|
|
256
264
|
};
|
|
257
265
|
|
|
258
|
-
|
|
259
|
-
|
|
266
|
+
// Markdown files
|
|
267
|
+
export const md = {
|
|
268
|
+
files: ['**/*.md'],
|
|
260
269
|
plugins: {
|
|
261
|
-
markdownlint
|
|
270
|
+
markdownlint,
|
|
262
271
|
},
|
|
263
272
|
rules: {
|
|
264
|
-
...
|
|
273
|
+
...markdownlint.configs.recommended.rules,
|
|
265
274
|
'markdownlint/md033': 'off',
|
|
266
275
|
'markdownlint/md041': 'off',
|
|
267
276
|
'prettier/prettier': ['warn', { parser: 'markdown' }],
|
|
268
277
|
},
|
|
269
278
|
};
|
|
270
279
|
|
|
271
|
-
|
|
272
|
-
|
|
280
|
+
// Package.json files
|
|
281
|
+
export const packageJson = {
|
|
282
|
+
files: ['**/package.json'],
|
|
273
283
|
rules: {
|
|
274
284
|
'prettier/prettier': ['warn', { parser: 'json' }],
|
|
275
285
|
},
|
|
@@ -305,106 +315,101 @@ const packageJson = {
|
|
|
305
315
|
},
|
|
306
316
|
};
|
|
307
317
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
318
|
+
// HTML files
|
|
319
|
+
export const htmlConfig = {
|
|
320
|
+
files: ['**/*.html'],
|
|
321
|
+
languageOptions: {
|
|
322
|
+
parser: htmlParser,
|
|
323
|
+
},
|
|
324
|
+
plugins: {
|
|
325
|
+
'@html-eslint': html,
|
|
312
326
|
},
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
const html = {
|
|
316
|
-
files: ['*.html'],
|
|
317
|
-
extends: ['plugin:@html-eslint/recommended'],
|
|
318
|
-
parser: '@html-eslint/parser',
|
|
319
|
-
plugins: ['@html-eslint'],
|
|
320
327
|
rules: {
|
|
328
|
+
...html.configs.recommended.rules,
|
|
321
329
|
'@html-eslint/element-newline': 'off',
|
|
322
330
|
'@html-eslint/indent': 'off',
|
|
323
331
|
'@html-eslint/no-extra-spacing-attrs': 'off',
|
|
324
332
|
'@html-eslint/require-closing-tags': 'off',
|
|
325
|
-
'
|
|
326
|
-
'warn',
|
|
327
|
-
{ selfClosing: 'always' },
|
|
328
|
-
],
|
|
333
|
+
'prettier/prettier': ['warn', { parser: 'html' }],
|
|
329
334
|
'spaced-comment': 'off',
|
|
330
335
|
strict: 'off',
|
|
331
|
-
'prettier/prettier': ['warn', { parser: 'html' }],
|
|
332
336
|
},
|
|
333
337
|
};
|
|
334
338
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
files: ['
|
|
338
|
-
|
|
339
|
+
// JSONC files
|
|
340
|
+
export const jsonc = {
|
|
341
|
+
files: ['**/*.jsonc', '**/*rc'],
|
|
342
|
+
languageOptions: {
|
|
343
|
+
parser: jsoncParser,
|
|
344
|
+
},
|
|
339
345
|
rules: {
|
|
340
346
|
'prettier/prettier': ['warn', { parser: 'json' }],
|
|
341
347
|
},
|
|
342
348
|
};
|
|
343
349
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
files: ['
|
|
347
|
-
|
|
350
|
+
// JSON5 files
|
|
351
|
+
export const json5 = {
|
|
352
|
+
files: ['**/*.json5'],
|
|
353
|
+
languageOptions: {
|
|
354
|
+
parser: jsoncParser,
|
|
355
|
+
},
|
|
348
356
|
rules: {
|
|
349
357
|
'prettier/prettier': ['warn', { parser: 'json5' }],
|
|
350
358
|
},
|
|
351
359
|
};
|
|
352
360
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
361
|
+
// Jest JavaScript files
|
|
362
|
+
export const jestJs = {
|
|
363
|
+
files: ['**/*.test.js', '**/__tests__/**/*.js'],
|
|
364
|
+
languageOptions: {
|
|
365
|
+
globals: { jest: true },
|
|
357
366
|
},
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
jest: true,
|
|
367
|
+
plugins: {
|
|
368
|
+
jest,
|
|
361
369
|
},
|
|
362
370
|
rules: {
|
|
371
|
+
...jest.configs.all.rules,
|
|
363
372
|
'jest/prefer-spy-on': 'warn',
|
|
364
373
|
'jest/require-top-level-describe': 'error',
|
|
365
|
-
'unicorn/no-array-callback-reference': 'off',
|
|
366
374
|
'jest/unbound-method': 'off',
|
|
367
|
-
'unicorn/
|
|
368
|
-
|
|
369
|
-
{
|
|
370
|
-
ignore: [/e2e/],
|
|
371
|
-
}
|
|
372
|
-
],
|
|
375
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
376
|
+
'unicorn/prevent-abbreviations': ['warn', { ignore: [/e2e/] }],
|
|
373
377
|
},
|
|
374
378
|
};
|
|
375
379
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
// Jest TypeScript files
|
|
381
|
+
export const jestTs = {
|
|
382
|
+
files: ['**/*.test.ts', '**/__tests__/**/*.ts'],
|
|
383
|
+
languageOptions: {
|
|
384
|
+
globals: { jest: true },
|
|
385
|
+
parser: tsParser,
|
|
382
386
|
},
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
jest
|
|
387
|
+
plugins: {
|
|
388
|
+
'@typescript-eslint': tsPlugin,
|
|
389
|
+
jest,
|
|
386
390
|
},
|
|
387
391
|
rules: {
|
|
392
|
+
...jest.configs.all.rules,
|
|
388
393
|
'jest/prefer-spy-on': 'warn',
|
|
389
394
|
'jest/require-top-level-describe': 'error',
|
|
390
|
-
'unicorn/no-array-callback-reference': 'off',
|
|
391
395
|
'jest/unbound-method': 'off',
|
|
392
|
-
'unicorn/
|
|
393
|
-
|
|
394
|
-
{
|
|
395
|
-
ignore: [/e2e/],
|
|
396
|
-
}
|
|
397
|
-
],
|
|
396
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
397
|
+
'unicorn/prevent-abbreviations': ['warn', { ignore: [/e2e/] }],
|
|
398
398
|
},
|
|
399
399
|
};
|
|
400
400
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
files: ['
|
|
404
|
-
plugins:
|
|
405
|
-
|
|
401
|
+
// Cypress files
|
|
402
|
+
export const cypressConfig = {
|
|
403
|
+
files: ['**/*.cy.*'],
|
|
404
|
+
plugins: {
|
|
405
|
+
cypress,
|
|
406
|
+
},
|
|
407
|
+
rules: {
|
|
408
|
+
...cypress.configs.recommended.rules,
|
|
409
|
+
},
|
|
406
410
|
};
|
|
407
411
|
|
|
412
|
+
// Export all overrides
|
|
408
413
|
export const baseOverrides = [
|
|
409
414
|
ts,
|
|
410
415
|
css,
|
|
@@ -414,11 +419,10 @@ export const baseOverrides = [
|
|
|
414
419
|
toml,
|
|
415
420
|
md,
|
|
416
421
|
packageJson,
|
|
417
|
-
|
|
418
|
-
html,
|
|
422
|
+
htmlConfig,
|
|
419
423
|
jsonc,
|
|
420
424
|
json5,
|
|
421
425
|
jestJs,
|
|
422
426
|
jestTs,
|
|
423
|
-
|
|
427
|
+
cypressConfig,
|
|
424
428
|
];
|