@wkovacs64/eslint-config 7.2.3 → 7.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +35 -29
- package/package.json +13 -13
package/index.js
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
// @ts-check
|
2
1
|
//
|
3
2
|
// Forked from https://github.com/epicweb-dev/config
|
4
3
|
//
|
5
|
-
import resolveFrom from 'resolve-from';
|
6
4
|
import globals from 'globals';
|
5
|
+
import { fixupPluginRules } from '@eslint/compat';
|
7
6
|
import eslint from '@eslint/js';
|
8
7
|
import tseslint from 'typescript-eslint';
|
9
8
|
import reactPlugin from 'eslint-plugin-react';
|
@@ -15,7 +14,12 @@ const WARN = 'warn';
|
|
15
14
|
const OFF = 'off';
|
16
15
|
|
17
16
|
function has(pkgName) {
|
18
|
-
|
17
|
+
try {
|
18
|
+
import.meta.resolve(pkgName, import.meta.url);
|
19
|
+
return true;
|
20
|
+
} catch {
|
21
|
+
return false;
|
22
|
+
}
|
19
23
|
}
|
20
24
|
|
21
25
|
const hasTypeScript = has('typescript');
|
@@ -27,7 +31,7 @@ const hasPlaywright = has('@playwright/test');
|
|
27
31
|
|
28
32
|
const vitestFiles = ['**/__tests__/**/*', '**/*.test.*'];
|
29
33
|
const testFiles = ['**/tests/**', '**/#tests/**', ...vitestFiles];
|
30
|
-
const playwrightFiles = ['**/playwright/**/*.
|
34
|
+
const playwrightFiles = ['**/playwright/**/*.spec.*'];
|
31
35
|
|
32
36
|
export const config = [
|
33
37
|
{
|
@@ -120,7 +124,7 @@ export const config = [
|
|
120
124
|
? {
|
121
125
|
files: ['**/*.ts?(x)', '**/*.js?(x)'],
|
122
126
|
plugins: {
|
123
|
-
'react-hooks': (await import('eslint-plugin-react-hooks'))
|
127
|
+
'react-hooks': fixupPluginRules(await import('eslint-plugin-react-hooks')),
|
124
128
|
},
|
125
129
|
rules: {
|
126
130
|
'react-hooks/rules-of-hooks': ERROR,
|
@@ -286,35 +290,37 @@ export const config = [
|
|
286
290
|
files: testFiles,
|
287
291
|
ignores: [...playwrightFiles],
|
288
292
|
plugins: {
|
289
|
-
'testing-library': (
|
293
|
+
'testing-library': fixupPluginRules(
|
294
|
+
(await import('eslint-plugin-testing-library')).default,
|
295
|
+
),
|
290
296
|
},
|
291
297
|
rules: {
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
298
|
+
'testing-library/await-async-events': ERROR,
|
299
|
+
'testing-library/await-async-queries': ERROR,
|
300
|
+
'testing-library/await-async-utils': ERROR,
|
301
|
+
'testing-library/consistent-data-testid': OFF,
|
302
|
+
'testing-library/no-await-sync-events': ERROR,
|
303
|
+
'testing-library/no-await-sync-queries': ERROR,
|
304
|
+
'testing-library/no-container': ERROR,
|
305
|
+
'testing-library/no-debugging-utils': OFF,
|
306
|
+
'testing-library/no-dom-import': [ERROR, 'react'],
|
307
|
+
'testing-library/no-global-regexp-flag-in-query': ERROR,
|
308
|
+
'testing-library/no-manual-cleanup': ERROR,
|
309
|
+
'testing-library/no-node-access': ERROR,
|
310
|
+
'testing-library/no-promise-in-fire-event': ERROR,
|
311
|
+
'testing-library/no-render-in-lifecycle': ERROR,
|
306
312
|
'testing-library/no-unnecessary-act': ERROR,
|
307
|
-
|
313
|
+
'testing-library/no-wait-for-multiple-assertions': ERROR,
|
308
314
|
'testing-library/no-wait-for-side-effects': ERROR,
|
309
|
-
|
310
|
-
|
315
|
+
'testing-library/no-wait-for-snapshot': ERROR,
|
316
|
+
'testing-library/prefer-explicit-assert': ERROR,
|
311
317
|
'testing-library/prefer-find-by': ERROR,
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
+
'testing-library/prefer-presence-queries': ERROR,
|
319
|
+
'testing-library/prefer-query-by-disappearance': ERROR,
|
320
|
+
'testing-library/prefer-query-matchers': OFF,
|
321
|
+
'testing-library/prefer-screen-queries': ERROR,
|
322
|
+
'testing-library/prefer-user-event': ERROR,
|
323
|
+
'testing-library/render-result-naming-convention': ERROR,
|
318
324
|
},
|
319
325
|
}
|
320
326
|
: null,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wkovacs64/eslint-config",
|
3
|
-
"version": "7.2.
|
3
|
+
"version": "7.2.5",
|
4
4
|
"description": "@wKovacs64 ESLint config",
|
5
5
|
"keywords": [
|
6
6
|
"eslint",
|
@@ -50,29 +50,29 @@
|
|
50
50
|
"node": "^18.18.0 || >=20.0.0"
|
51
51
|
},
|
52
52
|
"dependencies": {
|
53
|
-
"@eslint/
|
54
|
-
"eslint
|
53
|
+
"@eslint/compat": "^1.1.1",
|
54
|
+
"@eslint/js": "^9.7.0",
|
55
|
+
"eslint-plugin-import-x": "^3.0.1",
|
55
56
|
"eslint-plugin-jest-dom": "^5.4.0",
|
56
|
-
"eslint-plugin-jsx-a11y": "^6.
|
57
|
+
"eslint-plugin-jsx-a11y": "^6.9.0",
|
57
58
|
"eslint-plugin-playwright": "^1.6.2",
|
58
|
-
"eslint-plugin-react": "^7.34.
|
59
|
+
"eslint-plugin-react": "^7.34.3",
|
59
60
|
"eslint-plugin-react-hooks": "^4.6.2",
|
60
61
|
"eslint-plugin-testing-library": "^6.2.2",
|
61
62
|
"eslint-plugin-vitest": "^0.5.4",
|
62
|
-
"globals": "^15.
|
63
|
-
"
|
64
|
-
"typescript-eslint": "^8.0.0-alpha.20"
|
63
|
+
"globals": "^15.8.0",
|
64
|
+
"typescript-eslint": "^8.0.0-alpha.41"
|
65
65
|
},
|
66
66
|
"devDependencies": {
|
67
67
|
"@changesets/changelog-github": "0.5.0",
|
68
|
-
"@changesets/cli": "2.27.
|
68
|
+
"@changesets/cli": "2.27.7",
|
69
69
|
"@types/eslint__js": "8.42.3",
|
70
|
-
"@types/node": "20.14.
|
70
|
+
"@types/node": "20.14.10",
|
71
71
|
"@types/react": "18.3.3",
|
72
72
|
"@types/react-dom": "18.3.0",
|
73
|
-
"@wkovacs64/prettier-config": "4.1.
|
73
|
+
"@wkovacs64/prettier-config": "4.1.1",
|
74
74
|
"eslint": "8.57.0",
|
75
|
-
"prettier": "3.3.
|
76
|
-
"typescript": "5.
|
75
|
+
"prettier": "3.3.2",
|
76
|
+
"typescript": "5.5.3"
|
77
77
|
}
|
78
78
|
}
|