@mikey-pro/eslint-config 8.0.15 → 8.0.16
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/index.js +2 -0
- package/overrides.js +14 -4
- package/package.json +1 -1
- package/rules.js +3 -21
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import importSortPlugin from 'eslint-plugin-simple-import-sort';
|
|
|
14
14
|
import perfectionistPlugin from 'eslint-plugin-perfectionist';
|
|
15
15
|
import noSecretsPlugin from 'eslint-plugin-no-secrets';
|
|
16
16
|
import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests';
|
|
17
|
+
// Remove jest plugin import since it's now in overrides.js
|
|
17
18
|
|
|
18
19
|
import { baseOverrides } from './overrides.js';
|
|
19
20
|
import { baseRules } from './rules.js';
|
|
@@ -81,6 +82,7 @@ const config = [
|
|
|
81
82
|
perfectionist: perfectionistPlugin,
|
|
82
83
|
'no-secrets': noSecretsPlugin,
|
|
83
84
|
'no-only-tests': noOnlyTestsPlugin,
|
|
85
|
+
// Remove jest plugin from here since it's in overrides
|
|
84
86
|
},
|
|
85
87
|
rules: {
|
|
86
88
|
...baseRules,
|
package/overrides.js
CHANGED
|
@@ -4,6 +4,7 @@ import typescriptParser from '@typescript-eslint/parser';
|
|
|
4
4
|
import typeScriptPlugin from '@typescript-eslint/eslint-plugin';
|
|
5
5
|
import importPlugin from 'eslint-plugin-import';
|
|
6
6
|
import markdownPlugin from 'eslint-plugin-markdownlint';
|
|
7
|
+
import jestPlugin from 'eslint-plugin-jest';
|
|
7
8
|
|
|
8
9
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
9
10
|
|
|
@@ -357,13 +358,17 @@ const json5 = {
|
|
|
357
358
|
};
|
|
358
359
|
|
|
359
360
|
const jestJs = {
|
|
360
|
-
files: ['*.test.js'],
|
|
361
|
-
plugins:
|
|
361
|
+
files: ['*.test.js', '**/__tests__/**/*.js'],
|
|
362
|
+
plugins: {
|
|
363
|
+
jest: jestPlugin,
|
|
364
|
+
},
|
|
362
365
|
extends: ['plugin:jest/all'],
|
|
363
366
|
env: {
|
|
364
367
|
jest: true,
|
|
365
368
|
},
|
|
366
369
|
rules: {
|
|
370
|
+
'jest/prefer-spy-on': 'warn',
|
|
371
|
+
'jest/require-top-level-describe': 'error',
|
|
367
372
|
'unicorn/no-array-callback-reference': 'off',
|
|
368
373
|
'jest/unbound-method': 'off',
|
|
369
374
|
'unicorn/prevent-abbreviations': [
|
|
@@ -376,14 +381,19 @@ const jestJs = {
|
|
|
376
381
|
};
|
|
377
382
|
|
|
378
383
|
const jestTs = {
|
|
379
|
-
files: ['*.test.ts'],
|
|
384
|
+
files: ['*.test.ts', '**/__tests__/**/*.ts'],
|
|
380
385
|
parser: '@typescript-eslint/parser',
|
|
381
|
-
plugins:
|
|
386
|
+
plugins: {
|
|
387
|
+
'@typescript-eslint': typeScriptPlugin,
|
|
388
|
+
jest: jestPlugin,
|
|
389
|
+
},
|
|
382
390
|
extends: ['plugin:jest/all'],
|
|
383
391
|
env: {
|
|
384
392
|
jest: true,
|
|
385
393
|
},
|
|
386
394
|
rules: {
|
|
395
|
+
'jest/prefer-spy-on': 'warn',
|
|
396
|
+
'jest/require-top-level-describe': 'error',
|
|
387
397
|
'unicorn/no-array-callback-reference': 'off',
|
|
388
398
|
'jest/unbound-method': 'off',
|
|
389
399
|
'unicorn/prevent-abbreviations': [
|
package/package.json
CHANGED
package/rules.js
CHANGED
|
@@ -202,38 +202,20 @@ export const baseRules = {
|
|
|
202
202
|
|
|
203
203
|
// Security
|
|
204
204
|
'security/detect-non-literal-fs-filename': 'error',
|
|
205
|
-
'security/detect-unsafe-regex':
|
|
206
|
-
allowDollarMatchAll: false,
|
|
207
|
-
maxLength: 50
|
|
208
|
-
}],
|
|
205
|
+
'security/detect-unsafe-regex': 'error',
|
|
209
206
|
'security/detect-buffer-noassert': 'error',
|
|
210
207
|
'security/detect-child-process': 'warn',
|
|
211
208
|
'security/detect-disable-mustache-escape': 'error',
|
|
212
|
-
'security/detect-possible-timing-attacks':
|
|
213
|
-
|
|
214
|
-
catchAliases: true
|
|
215
|
-
}],
|
|
216
|
-
'security/detect-non-literal-regexp': ['error', {
|
|
217
|
-
report: 'error',
|
|
218
|
-
warnOnDynamicRegexp: true
|
|
219
|
-
}],
|
|
209
|
+
'security/detect-possible-timing-attacks': 'error',
|
|
210
|
+
'security/detect-non-literal-regexp': 'error',
|
|
220
211
|
'security/detect-non-literal-require': 'error',
|
|
221
212
|
|
|
222
|
-
// Better testing
|
|
223
|
-
'jest/prefer-spy-on': 'warn',
|
|
224
|
-
'jest/require-top-level-describe': 'error',
|
|
225
|
-
|
|
226
213
|
// Code Quality
|
|
227
214
|
'sonarjs/cognitive-complexity': ['error', 15],
|
|
228
215
|
'sonarjs/no-duplicate-string': ['error', 5],
|
|
229
216
|
'sonarjs/no-redundant-boolean': 'error',
|
|
230
217
|
'sonarjs/prefer-immediate-return': 'error',
|
|
231
218
|
|
|
232
|
-
// RegExp
|
|
233
|
-
'regexp/no-missing-g-flag': 'error',
|
|
234
|
-
'regexp/no-useless-flag': 'error',
|
|
235
|
-
'regexp/prefer-quantifier': 'error',
|
|
236
|
-
|
|
237
219
|
// Enhanced TypeScript
|
|
238
220
|
'etc/no-commented-out-code': 'warn',
|
|
239
221
|
'etc/no-implicit-any-catch': 'error',
|