@wkovacs64/eslint-config 7.2.3 → 7.2.5

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.
Files changed (2) hide show
  1. package/index.js +35 -29
  2. 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
- return Boolean(resolveFrom.silent(process.cwd(), pkgName));
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/**/*.(spec|test).*'];
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')).default,
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': (await import('eslint-plugin-testing-library')).default,
293
+ 'testing-library': fixupPluginRules(
294
+ (await import('eslint-plugin-testing-library')).default,
295
+ ),
290
296
  },
291
297
  rules: {
292
- // 'testing-library/await-async-events': ERROR,
293
- // 'testing-library/await-async-queries': ERROR,
294
- // 'testing-library/await-async-utils': ERROR,
295
- // 'testing-library/consistent-data-testid': OFF,
296
- // 'testing-library/no-await-sync-events': ERROR,
297
- // 'testing-library/no-await-sync-queries': ERROR,
298
- // 'testing-library/no-container': ERROR,
299
- // 'testing-library/no-debugging-utils': OFF,
300
- // 'testing-library/no-dom-import': [ERROR, 'react'],
301
- // 'testing-library/no-global-regexp-flag-in-query': ERROR,
302
- // 'testing-library/no-manual-cleanup': ERROR,
303
- // 'testing-library/no-node-access': ERROR,
304
- // 'testing-library/no-promise-in-fire-event': ERROR,
305
- // 'testing-library/no-render-in-lifecycle': ERROR,
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
- // 'testing-library/no-wait-for-multiple-assertions': ERROR,
313
+ 'testing-library/no-wait-for-multiple-assertions': ERROR,
308
314
  'testing-library/no-wait-for-side-effects': ERROR,
309
- // 'testing-library/no-wait-for-snapshot': ERROR,
310
- // 'testing-library/prefer-explicit-assert': ERROR,
315
+ 'testing-library/no-wait-for-snapshot': ERROR,
316
+ 'testing-library/prefer-explicit-assert': ERROR,
311
317
  'testing-library/prefer-find-by': ERROR,
312
- // 'testing-library/prefer-presence-queries': ERROR,
313
- // 'testing-library/prefer-query-by-disappearance': ERROR,
314
- // 'testing-library/prefer-query-matchers': OFF,
315
- // 'testing-library/prefer-screen-queries': ERROR,
316
- // 'testing-library/prefer-user-event': ERROR,
317
- // 'testing-library/render-result-naming-convention': ERROR,
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",
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/js": "^9.4.0",
54
- "eslint-plugin-import-x": "^0.5.1",
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.8.0",
57
+ "eslint-plugin-jsx-a11y": "^6.9.0",
57
58
  "eslint-plugin-playwright": "^1.6.2",
58
- "eslint-plugin-react": "^7.34.2",
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.3.0",
63
- "resolve-from": "5.0.0",
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.5",
68
+ "@changesets/cli": "2.27.7",
69
69
  "@types/eslint__js": "8.42.3",
70
- "@types/node": "20.14.2",
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.0",
73
+ "@wkovacs64/prettier-config": "4.1.1",
74
74
  "eslint": "8.57.0",
75
- "prettier": "3.3.1",
76
- "typescript": "5.4.5"
75
+ "prettier": "3.3.2",
76
+ "typescript": "5.5.3"
77
77
  }
78
78
  }