@wkovacs64/eslint-config 7.0.2 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/README.md +7 -11
  2. package/index.js +19 -15
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -11,14 +11,13 @@ This is my personal [ESLint][eslint] configuration.
11
11
  npm install --save-dev @wkovacs64/eslint-config
12
12
  ```
13
13
 
14
- > Be sure to install the appropriately versioned `eslint` peer dependency as
15
- > well.
14
+ > Be sure to install the appropriately versioned `eslint` peer dependency as well.
16
15
 
17
16
  ### Usage
18
17
 
19
- Follow the ESLint documentation on [shared configurations][eslint-sharing]. See
20
- the documentation on [ignoring files][eslint-ignores] if you need to ignore
21
- anything the config doesn't already ignore by default.
18
+ Follow the ESLint documentation on [shared configurations][eslint-sharing]. See the documentation on
19
+ [ignoring files][eslint-ignores] if you need to ignore anything the config doesn't already ignore by
20
+ default.
22
21
 
23
22
  ### Examples
24
23
 
@@ -48,17 +47,14 @@ export default config;
48
47
  }
49
48
  ```
50
49
 
51
- [npm-image]:
52
- https://img.shields.io/npm/v/@wkovacs64/eslint-config.svg?style=flat-square
50
+ [npm-image]: https://img.shields.io/npm/v/@wkovacs64/eslint-config.svg?style=flat-square
53
51
  [npm-url]: https://www.npmjs.com/package/@wkovacs64/eslint-config
54
52
  [ci-image]:
55
53
  https://img.shields.io/github/actions/workflow/status/wKovacs64/eslint-config/ci.yml?logo=github&style=flat-square
56
54
  [ci-url]: https://github.com/wKovacs64/eslint-config/actions?query=workflow%3Aci
57
- [changesets-image]:
58
- https://img.shields.io/badge/maintained%20with-changesets-blue?style=flat-square
55
+ [changesets-image]: https://img.shields.io/badge/maintained%20with-changesets-blue?style=flat-square
59
56
  [changesets-url]: https://github.com/changesets/changesets
60
57
  [eslint]: https://eslint.org/
61
58
  [eslint-sharing]:
62
59
  https://eslint.org/docs/latest/use/configure/configuration-files#using-a-shareable-configuration-package
63
- [eslint-ignores]:
64
- https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
60
+ [eslint-ignores]: https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
package/index.js CHANGED
@@ -5,6 +5,8 @@
5
5
  import globals from 'globals';
6
6
  import eslint from '@eslint/js';
7
7
  import tseslint from 'typescript-eslint';
8
+ import reactPlugin from 'eslint-plugin-react';
9
+ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
8
10
  import playwright from 'eslint-plugin-playwright';
9
11
 
10
12
  const ERROR = 'error';
@@ -26,7 +28,7 @@ const hasPlaywright = await has('playwright');
26
28
 
27
29
  const vitestFiles = ['**/__tests__/**/*', '**/*.test.*'];
28
30
  const testFiles = ['**/tests/**', '**/#tests/**', ...vitestFiles];
29
- const playwrightFiles = ['**/playwright/tests/**'];
31
+ const playwrightFiles = ['**/playwright/**/*.(spec|test).*'];
30
32
 
31
33
  export const config = [
32
34
  {
@@ -66,14 +68,7 @@ export const config = [
66
68
  { pattern: '#*/**', group: 'internal' },
67
69
  { pattern: '~/**', group: 'internal' },
68
70
  ],
69
- groups: [
70
- 'builtin',
71
- 'external',
72
- 'internal',
73
- 'parent',
74
- 'sibling',
75
- 'index',
76
- ],
71
+ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
77
72
  },
78
73
  ],
79
74
  },
@@ -82,10 +77,10 @@ export const config = [
82
77
  // JSX/TSX files
83
78
  hasReact
84
79
  ? {
85
- files: ['**/*.tsx', '**/*.jsx'].filter(Boolean),
80
+ files: ['**/*.tsx', '**/*.jsx'],
86
81
  plugins: {
87
- react: (await import('eslint-plugin-react')).default,
88
- 'jsx-a11y': (await import('eslint-plugin-jsx-a11y')).default,
82
+ react: reactPlugin,
83
+ 'jsx-a11y': jsxA11yPlugin,
89
84
  },
90
85
  languageOptions: {
91
86
  parserOptions: {
@@ -95,6 +90,8 @@ export const config = [
95
90
  },
96
91
  },
97
92
  rules: {
93
+ ...reactPlugin.configs.recommended.rules,
94
+ ...jsxA11yPlugin.configs.recommended.rules,
98
95
  'react/function-component-definition': [
99
96
  'error',
100
97
  {
@@ -102,7 +99,8 @@ export const config = [
102
99
  unnamedComponents: 'arrow-function',
103
100
  },
104
101
  ],
105
- 'react/jsx-key': WARN,
102
+ 'react/react-in-jsx-scope': OFF,
103
+ 'react/prop-types': OFF,
106
104
  'jsx-a11y/label-has-associated-control': [
107
105
  ERROR,
108
106
  {
@@ -252,6 +250,13 @@ export const config = [
252
250
  '@typescript-eslint/require-await': OFF,
253
251
  '@typescript-eslint/unified-signatures': 'warn',
254
252
  },
253
+ settings: {
254
+ 'import/resolver': {
255
+ typescript: {
256
+ alwaysTryTypes: true,
257
+ },
258
+ },
259
+ },
255
260
  }
256
261
  : null,
257
262
 
@@ -281,8 +286,7 @@ export const config = [
281
286
  files: testFiles,
282
287
  ignores: [...playwrightFiles],
283
288
  plugins: {
284
- 'testing-library': (await import('eslint-plugin-testing-library'))
285
- .default,
289
+ 'testing-library': (await import('eslint-plugin-testing-library')).default,
286
290
  },
287
291
  rules: {
288
292
  // 'testing-library/await-async-events': ERROR,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkovacs64/eslint-config",
3
- "version": "7.0.2",
3
+ "version": "7.1.0",
4
4
  "description": "@wKovacs64 ESLint config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -65,10 +65,10 @@
65
65
  "@changesets/changelog-github": "0.5.0",
66
66
  "@changesets/cli": "2.27.5",
67
67
  "@types/eslint__js": "8.42.3",
68
- "@types/node": "20.13.0",
68
+ "@types/node": "20.14.1",
69
69
  "@types/react": "18.3.3",
70
70
  "@types/react-dom": "18.3.0",
71
- "@wkovacs64/prettier-config": "4.0.0",
71
+ "@wkovacs64/prettier-config": "4.1.0",
72
72
  "eslint": "8.57.0",
73
73
  "prettier": "3.3.0",
74
74
  "typescript": "5.4.5"