@wkovacs64/eslint-config 7.2.4 → 7.3.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.
Files changed (2) hide show
  1. package/index.js +35 -31
  2. package/package.json +20 -19
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- // @ts-check
2
1
  //
3
2
  // Forked from https://github.com/epicweb-dev/config
4
3
  //
5
4
  import globals from 'globals';
5
+ import { fixupPluginRules } from '@eslint/compat';
6
6
  import eslint from '@eslint/js';
7
7
  import tseslint from 'typescript-eslint';
8
8
  import reactPlugin from 'eslint-plugin-react';
@@ -31,7 +31,8 @@ const hasPlaywright = has('@playwright/test');
31
31
 
32
32
  const vitestFiles = ['**/__tests__/**/*', '**/*.test.*'];
33
33
  const testFiles = ['**/tests/**', '**/#tests/**', ...vitestFiles];
34
- const playwrightFiles = ['**/playwright/**/*.(spec|test).*'];
34
+ const allPlaywrightFiles = ['**/playwright/**'];
35
+ const playwrightTestFiles = ['**/playwright/**/*.spec.*'];
35
36
 
36
37
  export const config = [
37
38
  {
@@ -123,6 +124,7 @@ export const config = [
123
124
  hasReact
124
125
  ? {
125
126
  files: ['**/*.ts?(x)', '**/*.js?(x)'],
127
+ ignores: [...allPlaywrightFiles],
126
128
  plugins: {
127
129
  'react-hooks': (await import('eslint-plugin-react-hooks')).default,
128
130
  },
@@ -288,37 +290,39 @@ export const config = [
288
290
  hasTestingLibrary
289
291
  ? {
290
292
  files: testFiles,
291
- ignores: [...playwrightFiles],
293
+ ignores: [...playwrightTestFiles],
292
294
  plugins: {
293
- 'testing-library': (await import('eslint-plugin-testing-library')).default,
295
+ 'testing-library': fixupPluginRules(
296
+ (await import('eslint-plugin-testing-library')).default,
297
+ ),
294
298
  },
295
299
  rules: {
296
- // 'testing-library/await-async-events': ERROR,
297
- // 'testing-library/await-async-queries': ERROR,
298
- // 'testing-library/await-async-utils': ERROR,
299
- // 'testing-library/consistent-data-testid': OFF,
300
- // 'testing-library/no-await-sync-events': ERROR,
301
- // 'testing-library/no-await-sync-queries': ERROR,
302
- // 'testing-library/no-container': ERROR,
303
- // 'testing-library/no-debugging-utils': OFF,
304
- // 'testing-library/no-dom-import': [ERROR, 'react'],
305
- // 'testing-library/no-global-regexp-flag-in-query': ERROR,
306
- // 'testing-library/no-manual-cleanup': ERROR,
307
- // 'testing-library/no-node-access': ERROR,
308
- // 'testing-library/no-promise-in-fire-event': ERROR,
309
- // 'testing-library/no-render-in-lifecycle': ERROR,
300
+ 'testing-library/await-async-events': ERROR,
301
+ 'testing-library/await-async-queries': ERROR,
302
+ 'testing-library/await-async-utils': ERROR,
303
+ 'testing-library/consistent-data-testid': OFF,
304
+ 'testing-library/no-await-sync-events': ERROR,
305
+ 'testing-library/no-await-sync-queries': ERROR,
306
+ 'testing-library/no-container': ERROR,
307
+ 'testing-library/no-debugging-utils': OFF,
308
+ 'testing-library/no-dom-import': [ERROR, 'react'],
309
+ 'testing-library/no-global-regexp-flag-in-query': ERROR,
310
+ 'testing-library/no-manual-cleanup': ERROR,
311
+ 'testing-library/no-node-access': ERROR,
312
+ 'testing-library/no-promise-in-fire-event': ERROR,
313
+ 'testing-library/no-render-in-lifecycle': ERROR,
310
314
  'testing-library/no-unnecessary-act': ERROR,
311
- // 'testing-library/no-wait-for-multiple-assertions': ERROR,
315
+ 'testing-library/no-wait-for-multiple-assertions': ERROR,
312
316
  'testing-library/no-wait-for-side-effects': ERROR,
313
- // 'testing-library/no-wait-for-snapshot': ERROR,
314
- // 'testing-library/prefer-explicit-assert': ERROR,
317
+ 'testing-library/no-wait-for-snapshot': ERROR,
318
+ 'testing-library/prefer-explicit-assert': ERROR,
315
319
  'testing-library/prefer-find-by': ERROR,
316
- // 'testing-library/prefer-presence-queries': ERROR,
317
- // 'testing-library/prefer-query-by-disappearance': ERROR,
318
- // 'testing-library/prefer-query-matchers': OFF,
319
- // 'testing-library/prefer-screen-queries': ERROR,
320
- // 'testing-library/prefer-user-event': ERROR,
321
- // 'testing-library/render-result-naming-convention': ERROR,
320
+ 'testing-library/prefer-presence-queries': ERROR,
321
+ 'testing-library/prefer-query-by-disappearance': ERROR,
322
+ 'testing-library/prefer-query-matchers': OFF,
323
+ 'testing-library/prefer-screen-queries': ERROR,
324
+ 'testing-library/prefer-user-event': ERROR,
325
+ 'testing-library/render-result-naming-convention': ERROR,
322
326
  },
323
327
  }
324
328
  : null,
@@ -326,7 +330,7 @@ export const config = [
326
330
  hasJestDom
327
331
  ? {
328
332
  files: testFiles,
329
- ignores: [...playwrightFiles],
333
+ ignores: [...playwrightTestFiles],
330
334
  plugins: {
331
335
  'jest-dom': (await import('eslint-plugin-jest-dom')).default,
332
336
  },
@@ -349,9 +353,9 @@ export const config = [
349
353
  hasVitest
350
354
  ? {
351
355
  files: testFiles,
352
- ignores: [...playwrightFiles],
356
+ ignores: [...playwrightTestFiles],
353
357
  plugins: {
354
- vitest: (await import('eslint-plugin-vitest')).default,
358
+ vitest: (await import('@vitest/eslint-plugin')).default,
355
359
  },
356
360
  rules: {
357
361
  // you don't want the editor to autofix this, but we do want to be
@@ -363,7 +367,7 @@ export const config = [
363
367
 
364
368
  hasPlaywright
365
369
  ? {
366
- files: playwrightFiles,
370
+ files: playwrightTestFiles,
367
371
  ...playwright.configs['flat/recommended'],
368
372
  }
369
373
  : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkovacs64/eslint-config",
3
- "version": "7.2.4",
3
+ "version": "7.3.0",
4
4
  "description": "@wKovacs64 ESLint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -50,28 +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.12.0",
55
+ "eslint-plugin-import-x": "^4.3.1",
55
56
  "eslint-plugin-jest-dom": "^5.4.0",
56
- "eslint-plugin-jsx-a11y": "^6.8.0",
57
- "eslint-plugin-playwright": "^1.6.2",
58
- "eslint-plugin-react": "^7.34.2",
59
- "eslint-plugin-react-hooks": "^4.6.2",
60
- "eslint-plugin-testing-library": "^6.2.2",
61
- "eslint-plugin-vitest": "^0.5.4",
62
- "globals": "^15.3.0",
63
- "typescript-eslint": "^8.0.0-alpha.20"
57
+ "eslint-plugin-jsx-a11y": "^6.10.0",
58
+ "eslint-plugin-playwright": "^1.7.0",
59
+ "eslint-plugin-react": "^7.37.1",
60
+ "eslint-plugin-react-hooks": "^5.0.0",
61
+ "eslint-plugin-testing-library": "^6.3.0",
62
+ "@vitest/eslint-plugin": "^1.1.7",
63
+ "globals": "^15.11.0",
64
+ "typescript-eslint": "^8.9.0"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@changesets/changelog-github": "0.5.0",
67
- "@changesets/cli": "2.27.5",
68
+ "@changesets/cli": "2.27.9",
68
69
  "@types/eslint__js": "8.42.3",
69
- "@types/node": "20.14.2",
70
- "@types/react": "18.3.3",
71
- "@types/react-dom": "18.3.0",
72
- "@wkovacs64/prettier-config": "4.1.0",
73
- "eslint": "8.57.0",
74
- "prettier": "3.3.1",
75
- "typescript": "5.4.5"
70
+ "@types/node": "20.16.11",
71
+ "@types/react": "18.3.11",
72
+ "@types/react-dom": "18.3.1",
73
+ "@wkovacs64/prettier-config": "4.1.1",
74
+ "eslint": "8.57.1",
75
+ "prettier": "3.3.3",
76
+ "typescript": "5.6.3"
76
77
  }
77
78
  }