@willbooster/eslint-config-js-react 10.1.1 → 11.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 +4 -4
- package/eslint.config.js +42 -0
- package/package.json +32 -28
- package/.eslintrc.json +0 -37
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# eslint-config-js-react
|
|
2
2
|
|
|
3
|
-
A ESLint config for JavaScript projects using React.
|
|
3
|
+
A ESLint flat config for JavaScript projects using React.
|
|
4
4
|
You need to do the following command to install peer dependencies.
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
7
|
yarn add -D @willbooster/eslint-config-js-react \
|
|
8
8
|
eslint \
|
|
9
9
|
eslint-config-prettier \
|
|
10
|
-
eslint-plugin-import \
|
|
10
|
+
eslint-plugin-import-x \
|
|
11
11
|
eslint-plugin-prettier \
|
|
12
12
|
eslint-plugin-react \
|
|
13
13
|
eslint-plugin-react-hooks \
|
|
14
14
|
eslint-plugin-sort-class-members \
|
|
15
15
|
eslint-plugin-sort-destructure-keys \
|
|
16
16
|
eslint-plugin-unicorn \
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
eslint-plugin-unused-imports \
|
|
18
|
+
globals
|
|
19
19
|
```
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import jsConfig from '@willbooster/eslint-config-js';
|
|
2
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
3
|
+
import eslintPluginReact from 'eslint-plugin-react';
|
|
4
|
+
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
...jsConfig,
|
|
8
|
+
{
|
|
9
|
+
files: ['{,src/**/,tests/**/,scripts/**/}*.jsx'],
|
|
10
|
+
},
|
|
11
|
+
// cf. https://github.com/jsx-eslint/eslint-plugin-react#flat-configs
|
|
12
|
+
eslintPluginReact.configs.flat.recommended,
|
|
13
|
+
eslintPluginReact.configs.flat['jsx-runtime'],
|
|
14
|
+
// cf. https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks#flat-config-eslintconfigjsts
|
|
15
|
+
eslintPluginReactHooks.configs['recommended-latest'],
|
|
16
|
+
{
|
|
17
|
+
settings: {
|
|
18
|
+
react: {
|
|
19
|
+
version: 'detect',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
rules: {
|
|
23
|
+
'react/jsx-sort-props': [
|
|
24
|
+
'error',
|
|
25
|
+
{
|
|
26
|
+
callbacksLast: true,
|
|
27
|
+
shorthandFirst: true,
|
|
28
|
+
reservedFirst: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
'react/no-unknown-property': [
|
|
32
|
+
'error',
|
|
33
|
+
{
|
|
34
|
+
ignore: ['global', 'jsx'],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'react/prop-types': 'off',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
// cf. https://github.com/prettier/eslint-config-prettier#installation
|
|
41
|
+
eslintConfigPrettier,
|
|
42
|
+
];
|
package/package.json
CHANGED
|
@@ -1,53 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/eslint-config-js-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A ESLint config for JavaScript projects using React",
|
|
3
|
+
"version": "11.0.0",
|
|
4
|
+
"description": "A ESLint flat config for JavaScript projects using React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "WillBooster Inc.",
|
|
7
|
-
"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "eslint.config.js",
|
|
8
9
|
"files": [
|
|
9
|
-
".
|
|
10
|
+
"eslint.config.js"
|
|
10
11
|
],
|
|
11
12
|
"scripts": {
|
|
12
13
|
"cleanup": "yarn format && yarn lint-fix",
|
|
13
14
|
"format": "sort-package-json && yarn prettify",
|
|
14
|
-
"lint": "eslint --color
|
|
15
|
+
"lint": "eslint --color",
|
|
15
16
|
"lint-fix": "yarn lint --fix --rule \"{ react-hooks/exhaustive-deps: 0 }\"",
|
|
16
17
|
"prettify": "prettier --cache --color --write \"**/{.*/,}*.{cjs,css,cts,htm,html,js,json,json5,jsonc,jsx,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}\" \"!**/test-fixtures/**\"",
|
|
17
18
|
"test": "yarn lint"
|
|
18
19
|
},
|
|
19
20
|
"prettier": "@willbooster/prettier-config",
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@willbooster/eslint-config-js": "
|
|
22
|
+
"@willbooster/eslint-config-js": "11.0.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"eslint": "
|
|
29
|
-
"eslint-
|
|
30
|
-
"eslint-plugin-
|
|
31
|
-
"eslint-plugin-
|
|
32
|
-
"eslint-plugin-react-hooks": "5.0.0",
|
|
33
|
-
"eslint-plugin-sort-class-members": "1.20.0",
|
|
25
|
+
"@eslint/js": "9.21.0",
|
|
26
|
+
"@willbooster/prettier-config": "10.0.0",
|
|
27
|
+
"eslint": "9.21.0",
|
|
28
|
+
"eslint-config-prettier": "10.0.2",
|
|
29
|
+
"eslint-plugin-import-x": "4.6.1",
|
|
30
|
+
"eslint-plugin-react": "7.37.4",
|
|
31
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
32
|
+
"eslint-plugin-sort-class-members": "1.21.0",
|
|
34
33
|
"eslint-plugin-sort-destructure-keys": "2.0.0",
|
|
35
|
-
"eslint-plugin-unicorn": "
|
|
36
|
-
"
|
|
34
|
+
"eslint-plugin-unicorn": "57.0.0",
|
|
35
|
+
"eslint-plugin-unused-imports": "4.1.4",
|
|
36
|
+
"globals": "16.0.0",
|
|
37
|
+
"lint-staged": "15.4.3",
|
|
37
38
|
"micromatch": "4.0.8",
|
|
38
|
-
"prettier": "3.
|
|
39
|
-
"react": "
|
|
40
|
-
"sort-package-json": "
|
|
39
|
+
"prettier": "3.5.3",
|
|
40
|
+
"react": "19.0.0",
|
|
41
|
+
"sort-package-json": "3.0.0"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"eslint": ">=
|
|
45
|
-
"eslint-config-prettier": ">=
|
|
46
|
-
"eslint-plugin-import": ">=
|
|
44
|
+
"@eslint/js": ">=9",
|
|
45
|
+
"eslint": ">=9",
|
|
46
|
+
"eslint-config-prettier": ">=10",
|
|
47
|
+
"eslint-plugin-import-x": ">=4",
|
|
47
48
|
"eslint-plugin-react": ">=7",
|
|
48
|
-
"eslint-plugin-react-hooks": ">=
|
|
49
|
-
"eslint-plugin-sort-class-members": ">=1.
|
|
50
|
-
"eslint-plugin-sort-destructure-keys": ">=
|
|
49
|
+
"eslint-plugin-react-hooks": ">=5",
|
|
50
|
+
"eslint-plugin-sort-class-members": ">=1.21",
|
|
51
|
+
"eslint-plugin-sort-destructure-keys": ">=2",
|
|
52
|
+
"eslint-plugin-unicorn": ">=57",
|
|
53
|
+
"eslint-plugin-unused-imports": ">=4",
|
|
54
|
+
"globals": ">=16"
|
|
51
55
|
},
|
|
52
56
|
"publishConfig": {
|
|
53
57
|
"access": "public"
|
package/.eslintrc.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"plugin:react/recommended",
|
|
4
|
-
"plugin:react/jsx-runtime",
|
|
5
|
-
"plugin:react-hooks/recommended",
|
|
6
|
-
"@willbooster/eslint-config-js"
|
|
7
|
-
],
|
|
8
|
-
"plugins": ["sort-destructure-keys"],
|
|
9
|
-
"parserOptions": {
|
|
10
|
-
"ecmaFeatures": {
|
|
11
|
-
"jsx": true
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"rules": {
|
|
15
|
-
"react/jsx-sort-props": [
|
|
16
|
-
"error",
|
|
17
|
-
{
|
|
18
|
-
"callbacksLast": true,
|
|
19
|
-
"shorthandFirst": true,
|
|
20
|
-
"reservedFirst": true
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"react/no-unknown-property": [
|
|
24
|
-
"error",
|
|
25
|
-
{
|
|
26
|
-
"ignore": ["global", "jsx"]
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"react/prop-types": "off"
|
|
30
|
-
},
|
|
31
|
-
"settings": {
|
|
32
|
-
"import/core-modules": ["react-dom"],
|
|
33
|
-
"react": {
|
|
34
|
-
"version": "detect"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|