@open-turo/eslint-config-react 17.0.24 → 18.0.0-pr-410.142.1.1
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/.pre-commit-config.yaml +2 -2
- package/index.cjs +2 -20
- package/pack/open-turo-eslint-config-react-18.0.0-pr-410.142.1.1.tgz +0 -0
- package/package.json +6 -7
- package/recommended.cjs +2 -16
- package/test/__snapshots__/test.spec.js.snap +43 -6
- package/pack/open-turo-eslint-config-react-17.0.24.tgz +0 -0
package/.pre-commit-config.yaml
CHANGED
|
@@ -10,7 +10,7 @@ repos:
|
|
|
10
10
|
hooks:
|
|
11
11
|
- id: prettier
|
|
12
12
|
stages: [pre-commit]
|
|
13
|
-
additional_dependencies: ["prettier@3.
|
|
13
|
+
additional_dependencies: ["prettier@3.7.1"]
|
|
14
14
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
15
15
|
rev: v6.0.0
|
|
16
16
|
hooks:
|
|
@@ -19,6 +19,6 @@ repos:
|
|
|
19
19
|
- id: end-of-file-fixer
|
|
20
20
|
- id: trailing-whitespace
|
|
21
21
|
- repo: https://github.com/rhysd/actionlint
|
|
22
|
-
rev: v1.7.
|
|
22
|
+
rev: v1.7.9
|
|
23
23
|
hooks:
|
|
24
24
|
- id: actionlint
|
package/index.cjs
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const turoConfig = require("@open-turo/eslint-config-typescript");
|
|
4
4
|
const jsxA11yPlugin = require("eslint-plugin-jsx-a11y");
|
|
5
5
|
const reactPlugin = require("eslint-plugin-react");
|
|
6
|
-
const reactCompilerPlugin = require("eslint-plugin-react-compiler");
|
|
7
6
|
const reactHooksPlugin = require("eslint-plugin-react-hooks");
|
|
8
7
|
const eslintConfig = require("eslint/config");
|
|
9
8
|
const globals = require("globals");
|
|
@@ -73,9 +72,9 @@ module.exports = function config(options = {}) {
|
|
|
73
72
|
extends: [
|
|
74
73
|
reactPlugin.configs.flat["recommended"],
|
|
75
74
|
reactPlugin.configs.flat["jsx-runtime"],
|
|
75
|
+
// @ts-expect-error -- Unlcear why the types are wrong, matches README setup: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y?tab=readme-ov-file#shareable-configs
|
|
76
76
|
jsxA11yPlugin.flatConfigs.recommended,
|
|
77
|
-
|
|
78
|
-
reactHooksPlugin.configs.recommended,
|
|
77
|
+
reactHooksPlugin.configs.flat.recommended,
|
|
79
78
|
],
|
|
80
79
|
files: ["**/*.{jsx,tsx,mjsx,cjsx}"],
|
|
81
80
|
languageOptions: {
|
|
@@ -83,9 +82,6 @@ module.exports = function config(options = {}) {
|
|
|
83
82
|
...globals.browser,
|
|
84
83
|
},
|
|
85
84
|
},
|
|
86
|
-
plugins: {
|
|
87
|
-
"react-hooks": reactHooksPlugin,
|
|
88
|
-
},
|
|
89
85
|
rules: {
|
|
90
86
|
"jsx-a11y/anchor-is-valid": [
|
|
91
87
|
"warn",
|
|
@@ -93,20 +89,6 @@ module.exports = function config(options = {}) {
|
|
|
93
89
|
specialLink: ["to"],
|
|
94
90
|
},
|
|
95
91
|
],
|
|
96
|
-
/** ESLint plugin for the React Compiler, to enforce rules that make adopting it easier/more effective */
|
|
97
|
-
"react-compiler/react-compiler": [
|
|
98
|
-
"error",
|
|
99
|
-
{
|
|
100
|
-
environment: {
|
|
101
|
-
/**
|
|
102
|
-
* At the time of writing, `eslint-plugin-react-compiler` errors on ref usages in render paths. This rule is noisy,
|
|
103
|
-
* since it currently reports false positives. We can remove this in the future when the rule is more accurate.
|
|
104
|
-
* {@link https://github.com/facebook/react/pull/30843 PR that disables this rule in the default config}
|
|
105
|
-
*/
|
|
106
|
-
validateRefAccessDuringRender: false,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
92
|
// don't force .jsx extension
|
|
111
93
|
"react/jsx-filename-extension": "off",
|
|
112
94
|
// In TS you must use the Fragment syntax instead of the shorthand
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
"description": "Turo eslint configuration for react",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@open-turo/eslint-config-typescript": "18.1.
|
|
6
|
+
"@open-turo/eslint-config-typescript": "18.1.18",
|
|
7
7
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
8
8
|
"eslint-plugin-react": "7.37.5",
|
|
9
|
-
"eslint-plugin-react-
|
|
10
|
-
"eslint-plugin-react-hooks": "6.1.1",
|
|
9
|
+
"eslint-plugin-react-hooks": "7.0.1",
|
|
11
10
|
"globals": "16.5.0",
|
|
12
|
-
"typescript-eslint": "8.
|
|
11
|
+
"typescript-eslint": "8.48.0"
|
|
13
12
|
},
|
|
14
13
|
"devDependencies": {
|
|
15
|
-
"@types/react": "19.2.
|
|
14
|
+
"@types/react": "19.2.7",
|
|
16
15
|
"eslint": "9.39.1",
|
|
17
16
|
"jest": "30.2.0",
|
|
18
|
-
"prettier": "3.
|
|
17
|
+
"prettier": "3.7.1",
|
|
19
18
|
"react": "19.2.0"
|
|
20
19
|
},
|
|
21
20
|
"engines": {
|
|
@@ -49,5 +48,5 @@
|
|
|
49
48
|
"access": "public"
|
|
50
49
|
},
|
|
51
50
|
"repository": "https://github.com/open-turo/eslint-config-react",
|
|
52
|
-
"version": "
|
|
51
|
+
"version": "18.0.0-pr-410.142.1.1"
|
|
53
52
|
}
|
package/recommended.cjs
CHANGED
|
@@ -6,7 +6,7 @@ module.exports = {
|
|
|
6
6
|
"@open-turo/eslint-config-typescript/recommended",
|
|
7
7
|
"plugin:react/recommended",
|
|
8
8
|
"plugin:react/jsx-runtime",
|
|
9
|
-
"plugin:react-hooks/recommended
|
|
9
|
+
"plugin:react-hooks/recommended",
|
|
10
10
|
"plugin:jsx-a11y/recommended",
|
|
11
11
|
],
|
|
12
12
|
ignorePatterns: ["babel.config.js"],
|
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
|
16
16
|
},
|
|
17
17
|
jsxPragma: "React",
|
|
18
18
|
},
|
|
19
|
-
plugins: ["react", "react-hooks", "jsx-a11y"
|
|
19
|
+
plugins: ["react", "react-hooks", "jsx-a11y"],
|
|
20
20
|
root: true,
|
|
21
21
|
rules: {
|
|
22
22
|
"jsx-a11y/anchor-is-valid": [
|
|
@@ -37,20 +37,6 @@ module.exports = {
|
|
|
37
37
|
],
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
|
-
/** ESLint plugin for the React Compiler, to enforce rules that make adopting it easier/more effective */
|
|
41
|
-
"react-compiler/react-compiler": [
|
|
42
|
-
"error",
|
|
43
|
-
{
|
|
44
|
-
environment: {
|
|
45
|
-
/**
|
|
46
|
-
* At the time of writing, `eslint-plugin-react-compiler` errors on ref usages in render paths. This rule is noisy,
|
|
47
|
-
* since it currently reports false positives. We can remove this in the future when the rule is more accurate.
|
|
48
|
-
* {@link https://github.com/facebook/react/pull/30843 PR that disables this rule in the default config}
|
|
49
|
-
*/
|
|
50
|
-
validateRefAccessDuringRender: false,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
40
|
// don't force .jsx extension
|
|
55
41
|
"react/jsx-filename-extension": "off",
|
|
56
42
|
// In TS you must use the Fragment syntax instead of the shorthand
|
|
@@ -7987,20 +7987,57 @@ exports[`validate config the legacy recommended config is correct 1`] = `
|
|
|
7987
7987
|
"quotes": [
|
|
7988
7988
|
0,
|
|
7989
7989
|
],
|
|
7990
|
-
"react-
|
|
7990
|
+
"react-hooks/component-hook-factories": [
|
|
7991
|
+
"error",
|
|
7992
|
+
],
|
|
7993
|
+
"react-hooks/config": [
|
|
7994
|
+
"error",
|
|
7995
|
+
],
|
|
7996
|
+
"react-hooks/error-boundaries": [
|
|
7991
7997
|
"error",
|
|
7992
|
-
{
|
|
7993
|
-
"environment": {
|
|
7994
|
-
"validateRefAccessDuringRender": false,
|
|
7995
|
-
},
|
|
7996
|
-
},
|
|
7997
7998
|
],
|
|
7998
7999
|
"react-hooks/exhaustive-deps": [
|
|
7999
8000
|
"warn",
|
|
8000
8001
|
],
|
|
8002
|
+
"react-hooks/gating": [
|
|
8003
|
+
"error",
|
|
8004
|
+
],
|
|
8005
|
+
"react-hooks/globals": [
|
|
8006
|
+
"error",
|
|
8007
|
+
],
|
|
8008
|
+
"react-hooks/immutability": [
|
|
8009
|
+
"error",
|
|
8010
|
+
],
|
|
8011
|
+
"react-hooks/incompatible-library": [
|
|
8012
|
+
"warn",
|
|
8013
|
+
],
|
|
8014
|
+
"react-hooks/preserve-manual-memoization": [
|
|
8015
|
+
"error",
|
|
8016
|
+
],
|
|
8017
|
+
"react-hooks/purity": [
|
|
8018
|
+
"error",
|
|
8019
|
+
],
|
|
8020
|
+
"react-hooks/refs": [
|
|
8021
|
+
"error",
|
|
8022
|
+
],
|
|
8001
8023
|
"react-hooks/rules-of-hooks": [
|
|
8002
8024
|
"error",
|
|
8003
8025
|
],
|
|
8026
|
+
"react-hooks/set-state-in-effect": [
|
|
8027
|
+
"error",
|
|
8028
|
+
],
|
|
8029
|
+
"react-hooks/set-state-in-render": [
|
|
8030
|
+
"error",
|
|
8031
|
+
],
|
|
8032
|
+
"react-hooks/static-components": [
|
|
8033
|
+
"error",
|
|
8034
|
+
],
|
|
8035
|
+
"react-hooks/unsupported-syntax": [
|
|
8036
|
+
"warn",
|
|
8037
|
+
],
|
|
8038
|
+
"react-hooks/use-memo": [
|
|
8039
|
+
"error",
|
|
8040
|
+
],
|
|
8004
8041
|
"react/display-name": [
|
|
8005
8042
|
2,
|
|
8006
8043
|
],
|
|
Binary file
|