@geops/eslint-config-react 1.5.0 → 1.6.0-beta.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 +1 -1
- package/flat/index.mjs +3 -4
- package/index.js +1 -2
- package/package.json +8 -9
- package/rules.json +6 -7
package/README.md
CHANGED
|
@@ -28,4 +28,4 @@ Then, create a `.eslintrc.json` file in the root of your project with the follow
|
|
|
28
28
|
|
|
29
29
|
## Updating rules
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Add rule customizations to `rules.json` which gets used in legacy config as well as flat config.
|
package/flat/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import eslint from "@eslint/js";
|
|
2
|
+
import { defineConfig } from "eslint/config";
|
|
2
3
|
import cypress from "eslint-plugin-cypress/flat";
|
|
3
4
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
4
5
|
import mocha from "eslint-plugin-mocha";
|
|
5
6
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
6
7
|
import prettier from "eslint-plugin-prettier/recommended";
|
|
7
8
|
import react from "eslint-plugin-react";
|
|
8
|
-
import reactCompiler from "eslint-plugin-react-compiler";
|
|
9
9
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
10
10
|
import globals from "globals";
|
|
11
11
|
import tseslint from "typescript-eslint";
|
|
12
12
|
|
|
13
13
|
import rules from "../rules.json" with { type: "json" };
|
|
14
14
|
|
|
15
|
-
export default
|
|
15
|
+
export default defineConfig(
|
|
16
16
|
eslint.configs.recommended,
|
|
17
17
|
tseslint.configs.recommendedTypeChecked,
|
|
18
18
|
tseslint.configs.stylisticTypeChecked,
|
|
@@ -22,8 +22,7 @@ export default tseslint.config(
|
|
|
22
22
|
perfectionist.configs["recommended-alphabetical"],
|
|
23
23
|
react.configs.flat.recommended,
|
|
24
24
|
react.configs.flat["jsx-runtime"], // Avoid having the React-in-jsx-scope rule activated
|
|
25
|
-
reactHooks.configs
|
|
26
|
-
reactCompiler.configs.recommended,
|
|
25
|
+
reactHooks.configs.recommended,
|
|
27
26
|
prettier,
|
|
28
27
|
{
|
|
29
28
|
languageOptions: {
|
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@ module.exports = {
|
|
|
13
13
|
"plugin:perfectionist/recommended-alphabetical-legacy",
|
|
14
14
|
"plugin:react/recommended",
|
|
15
15
|
"plugin:react/jsx-runtime",
|
|
16
|
-
"plugin:react-hooks/recommended",
|
|
16
|
+
"plugin:react-hooks/recommended-legacy",
|
|
17
17
|
"prettier",
|
|
18
18
|
],
|
|
19
19
|
globals: {
|
|
@@ -27,7 +27,6 @@ module.exports = {
|
|
|
27
27
|
parserOptions: {
|
|
28
28
|
project: true,
|
|
29
29
|
},
|
|
30
|
-
plugins: ["eslint-plugin-react-compiler"],
|
|
31
30
|
rules: rules,
|
|
32
31
|
settings: {
|
|
33
32
|
react: { version: "detect" },
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geops/eslint-config-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-beta.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"eslint-config-prettier": "^10.1.
|
|
6
|
-
"eslint-plugin-cypress": "^
|
|
5
|
+
"eslint-config-prettier": "^10.1.8",
|
|
6
|
+
"eslint-plugin-cypress": "^5.2.0",
|
|
7
7
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
8
|
-
"eslint-plugin-mocha": "^11.
|
|
9
|
-
"eslint-plugin-perfectionist": "^4.
|
|
10
|
-
"eslint-plugin-prettier": "^5.4
|
|
8
|
+
"eslint-plugin-mocha": "^11.2.0",
|
|
9
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
10
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
11
11
|
"eslint-plugin-react": "^7.37.5",
|
|
12
|
-
"eslint-plugin-react-
|
|
13
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
12
|
+
"eslint-plugin-react-hooks": "^6.1.0",
|
|
14
13
|
"globals": "^16.0.0",
|
|
15
|
-
"typescript-eslint": "^8.
|
|
14
|
+
"typescript-eslint": "^8.45.0"
|
|
16
15
|
},
|
|
17
16
|
"exports": {
|
|
18
17
|
".": "./index.js",
|
package/rules.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"import/order": "off",
|
|
3
2
|
"arrow-body-style": ["error", "always"],
|
|
4
3
|
"curly": "error",
|
|
5
|
-
"
|
|
6
|
-
"prefer-template": "error",
|
|
7
|
-
"react-compiler/react-compiler": "error",
|
|
8
|
-
"react-hooks/exhaustive-deps": "error",
|
|
4
|
+
"import/order": "off",
|
|
9
5
|
"mocha/no-exclusive-tests": "error",
|
|
10
6
|
"mocha/no-mocha-arrows": "off",
|
|
11
7
|
"mocha/no-pending-tests": "error",
|
|
8
|
+
"no-console": "warn",
|
|
12
9
|
"no-nested-ternary": "error",
|
|
10
|
+
"no-param-reassign": "error",
|
|
13
11
|
"no-restricted-globals": [
|
|
14
12
|
"error",
|
|
15
13
|
"addEventListener",
|
|
@@ -73,7 +71,6 @@
|
|
|
73
71
|
"toolbar",
|
|
74
72
|
"top"
|
|
75
73
|
],
|
|
76
|
-
"no-param-reassign": "error",
|
|
77
74
|
"perfectionist/sort-imports": [
|
|
78
75
|
"error",
|
|
79
76
|
{
|
|
@@ -101,10 +98,12 @@
|
|
|
101
98
|
}
|
|
102
99
|
],
|
|
103
100
|
"perfectionist/sort-modules": "off",
|
|
101
|
+
"prefer-template": "error",
|
|
104
102
|
"react/destructuring-assignment": "error",
|
|
103
|
+
"react-hooks/exhaustive-deps": "error",
|
|
105
104
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
105
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
106
106
|
"@typescript-eslint/no-shadow": "error",
|
|
107
107
|
"@typescript-eslint/no-use-before-define": "error",
|
|
108
|
-
"@typescript-eslint/no-empty-function": "warn",
|
|
109
108
|
"@typescript-eslint/prefer-nullish-coalescing": "warn"
|
|
110
109
|
}
|