@willbooster/eslint-config-next 2.6.2 → 3.0.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.
- package/README.md +2 -2
- package/eslint.config.js +27 -16
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@ Install the package and its peer dependencies.
|
|
|
6
6
|
```sh
|
|
7
7
|
yarn add -D @willbooster/eslint-config-next \
|
|
8
8
|
@eslint/js \
|
|
9
|
+
@eslint-react/eslint-plugin \
|
|
9
10
|
@next/eslint-plugin-next \
|
|
10
11
|
eslint \
|
|
11
12
|
eslint-config-flat-gitignore \
|
|
12
13
|
eslint-config-prettier \
|
|
13
14
|
eslint-plugin-import-x \
|
|
14
|
-
eslint-plugin-
|
|
15
|
+
eslint-plugin-perfectionist \
|
|
15
16
|
eslint-plugin-react-compiler \
|
|
16
|
-
eslint-plugin-react-hooks \
|
|
17
17
|
eslint-plugin-sort-class-members \
|
|
18
18
|
eslint-plugin-sort-destructure-keys \
|
|
19
19
|
eslint-plugin-unicorn \
|
package/eslint.config.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable unicorn/no-null */
|
|
2
2
|
|
|
3
3
|
import js from '@eslint/js';
|
|
4
|
+
import eslintPluginReact from '@eslint-react/eslint-plugin';
|
|
4
5
|
import eslintPluginNext from '@next/eslint-plugin-next';
|
|
5
6
|
import eslintConfigFlatGitignore from 'eslint-config-flat-gitignore';
|
|
6
7
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
7
8
|
import eslintPluginImportX from 'eslint-plugin-import-x';
|
|
8
|
-
import
|
|
9
|
+
import eslintPluginPerfectionist from 'eslint-plugin-perfectionist';
|
|
9
10
|
import eslintPluginReactCompiler from 'eslint-plugin-react-compiler';
|
|
10
|
-
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
|
|
11
11
|
import eslintPluginSortClassMembers from 'eslint-plugin-sort-class-members';
|
|
12
12
|
import eslintPluginSortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
|
|
13
13
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
@@ -16,7 +16,6 @@ import globals from 'globals';
|
|
|
16
16
|
import tseslint from 'typescript-eslint';
|
|
17
17
|
|
|
18
18
|
const { flatConfig: eslintPluginNextFlatConfig } = eslintPluginNext;
|
|
19
|
-
const reactHooksFlatRecommended = eslintPluginReactHooks.configs.flat.recommended;
|
|
20
19
|
|
|
21
20
|
const config = [
|
|
22
21
|
// Since eslintPluginNextFlatConfig.coreWebVitals does not work on Next.js 16 beta.
|
|
@@ -67,6 +66,11 @@ const config = [
|
|
|
67
66
|
},
|
|
68
67
|
languageOptions: {
|
|
69
68
|
ecmaVersion: 'latest',
|
|
69
|
+
parserOptions: {
|
|
70
|
+
ecmaFeatures: {
|
|
71
|
+
jsx: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
70
74
|
globals: {
|
|
71
75
|
// for Web
|
|
72
76
|
...globals.browser,
|
|
@@ -121,35 +125,42 @@ const config = [
|
|
|
121
125
|
// -----------------------------------------------------------
|
|
122
126
|
|
|
123
127
|
// --------------- from eslint-config-js-react ---------------
|
|
124
|
-
// cf. https://
|
|
125
|
-
eslintPluginReact.configs.
|
|
126
|
-
eslintPluginReact.configs.flat['jsx-runtime'],
|
|
127
|
-
// cf. https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks#readme
|
|
128
|
-
reactHooksFlatRecommended,
|
|
128
|
+
// cf. https://eslint-react.xyz/docs/migrating-from-eslint-plugin-react
|
|
129
|
+
eslintPluginReact.configs.recommended,
|
|
129
130
|
// cf. https://www.npmjs.com/package/eslint-plugin-react-compiler
|
|
130
131
|
eslintPluginReactCompiler.configs.recommended,
|
|
131
132
|
{
|
|
133
|
+
plugins: {
|
|
134
|
+
perfectionist: eslintPluginPerfectionist,
|
|
135
|
+
},
|
|
132
136
|
settings: {
|
|
133
|
-
react: {
|
|
137
|
+
'react-x': {
|
|
134
138
|
version: 'detect',
|
|
135
139
|
},
|
|
136
140
|
},
|
|
137
141
|
rules: {
|
|
138
|
-
'react/
|
|
142
|
+
'@eslint-react/dom-no-unknown-property': [
|
|
139
143
|
'error',
|
|
140
144
|
{
|
|
141
|
-
|
|
142
|
-
shorthandFirst: true,
|
|
143
|
-
reservedFirst: true,
|
|
145
|
+
ignore: ['global', 'jsx'],
|
|
144
146
|
},
|
|
145
147
|
],
|
|
146
|
-
'
|
|
148
|
+
'perfectionist/sort-jsx-props': [
|
|
147
149
|
'error',
|
|
148
150
|
{
|
|
149
|
-
|
|
151
|
+
customGroups: [
|
|
152
|
+
{
|
|
153
|
+
groupName: 'reserved',
|
|
154
|
+
elementNamePattern: '^(children|dangerouslySetInnerHTML|key|ref)$',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
groupName: 'callback',
|
|
158
|
+
elementNamePattern: '^on[A-Z]',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
groups: ['reserved', 'shorthand-prop', 'unknown', 'callback'],
|
|
150
162
|
},
|
|
151
163
|
],
|
|
152
|
-
'react/prop-types': 'off',
|
|
153
164
|
},
|
|
154
165
|
},
|
|
155
166
|
// -----------------------------------------------------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/eslint-config-next",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "ESLint flat config for Next.js projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,29 +20,29 @@
|
|
|
20
20
|
"cleanup": "yarn format && yarn lint-fix",
|
|
21
21
|
"format": "sort-package-json && yarn prettify",
|
|
22
22
|
"lint": "eslint --color",
|
|
23
|
-
"lint-fix": "yarn lint --fix --rule \"{ react
|
|
23
|
+
"lint-fix": "yarn lint --fix --rule \"{ '@eslint-react/exhaustive-deps': 0 }\"",
|
|
24
24
|
"prettify": "prettier --cache --color --write \"**/{.*/,}*.{cjs,css,cts,htm,html,java,js,json,json5,jsonc,jsx,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}\" \"!**/test{-,/}fixtures/**\" || true",
|
|
25
25
|
"test": "yarn lint",
|
|
26
26
|
"typecheck": "tsc --noEmit --Pretty"
|
|
27
27
|
},
|
|
28
28
|
"prettier": "@willbooster/prettier-config",
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@eslint-react/eslint-plugin": "4.2.3",
|
|
30
31
|
"@eslint/eslintrc": "3.3.5",
|
|
31
|
-
"@eslint/js": "
|
|
32
|
+
"@eslint/js": "10.0.1",
|
|
32
33
|
"@types/eslint": "9.6.1",
|
|
33
34
|
"@types/micromatch": "4.0.10",
|
|
34
35
|
"@types/node": "25.5.0",
|
|
35
36
|
"@types/react": "19.2.14",
|
|
36
37
|
"@willbooster/prettier-config": "10.4.0",
|
|
37
|
-
"eslint": "
|
|
38
|
+
"eslint": "10.2.0",
|
|
38
39
|
"eslint-config-flat-gitignore": "2.3.0",
|
|
39
40
|
"eslint-config-next": "16.2.1",
|
|
40
41
|
"eslint-config-prettier": "10.1.8",
|
|
41
42
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
42
43
|
"eslint-plugin-import-x": "4.16.2",
|
|
43
|
-
"eslint-plugin-
|
|
44
|
+
"eslint-plugin-perfectionist": "5.8.0",
|
|
44
45
|
"eslint-plugin-react-compiler": "19.1.0-rc.2",
|
|
45
|
-
"eslint-plugin-react-hooks": "7.0.1",
|
|
46
46
|
"eslint-plugin-sort-class-members": "1.21.0",
|
|
47
47
|
"eslint-plugin-sort-destructure-keys": "3.0.0",
|
|
48
48
|
"eslint-plugin-unicorn": "64.0.0",
|
|
@@ -55,20 +55,20 @@
|
|
|
55
55
|
"react": "19.2.4",
|
|
56
56
|
"sort-package-json": "3.6.1",
|
|
57
57
|
"typescript": "6.0.2",
|
|
58
|
-
"typescript-eslint": "8.58.
|
|
58
|
+
"typescript-eslint": "8.58.1",
|
|
59
59
|
"use-immer": "0.11.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@eslint/
|
|
62
|
+
"@eslint-react/eslint-plugin": ">=4.2.3",
|
|
63
|
+
"@eslint/js": ">=10",
|
|
63
64
|
"@next/eslint-plugin-next": ">=16",
|
|
64
|
-
"eslint": ">=
|
|
65
|
+
"eslint": ">=10",
|
|
65
66
|
"eslint-config-flat-gitignore": ">=2.1",
|
|
66
67
|
"eslint-config-prettier": ">=10",
|
|
67
68
|
"eslint-import-resolver-typescript": ">=4",
|
|
68
69
|
"eslint-plugin-import-x": ">=4",
|
|
69
|
-
"eslint-plugin-
|
|
70
|
+
"eslint-plugin-perfectionist": ">=5.8",
|
|
70
71
|
"eslint-plugin-react-compiler": ">=19.1.0-rc.2",
|
|
71
|
-
"eslint-plugin-react-hooks": ">=6",
|
|
72
72
|
"eslint-plugin-sort-class-members": ">=1.21",
|
|
73
73
|
"eslint-plugin-sort-destructure-keys": ">=2",
|
|
74
74
|
"eslint-plugin-unicorn": ">=59",
|