@open-turo/eslint-config-react 18.0.8 → 19.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.
@@ -0,0 +1,6 @@
1
+ # Breaking changes in v19
2
+
3
+ - Sets `react-hooks/todo` to error on React Compiler de-opt syntax.
4
+ - As a work-around, either `// eslint-disable` existing violations, or re-write code to use syntax that allows for compiler optimization.
5
+ - Ports over changes from `recommended.cjs` to `index.cjs`, as we have not kept rules in sync.
6
+ - The breaking changes from v18 will surface in usages that use the ESLint v9 flat config instead of the legacy `/recommended` config.
package/index.cjs CHANGED
@@ -89,6 +89,29 @@ module.exports = function config(options = {}) {
89
89
  specialLink: ["to"],
90
90
  },
91
91
  ],
92
+ /**
93
+ * We enforce this as error to be more thoroughly React Compiler-compliant.
94
+ *
95
+ * {@link https://react.dev/reference/eslint-plugin-react-hooks/lints/exhaustive-deps docs}
96
+ */
97
+ "react-hooks/exhaustive-deps": "error",
98
+ /**
99
+ * Set as "warn" by default, we want to error on incompatible library APIs for dev visibility (to require // eslint-disable)
100
+ *
101
+ * {@link https://react.dev/reference/eslint-plugin-react-hooks/lints/incompatible-library docs}
102
+ */
103
+ "react-hooks/incompatible-library": "error",
104
+ /**
105
+ * Technically an undocumented rule, this rule surfaces in syntax that causes the React Compiler to de-opt.
106
+ * Raising errors increases visibility into whether a component/hook as written cannot be optimized.
107
+ */
108
+ "react-hooks/todo": "error",
109
+ /**
110
+ * Not a rule we expect to see, but all other rules are set to "error", and so we set this one to "error" too (to require // eslint-disable)
111
+ *
112
+ * {@link https://react.dev/reference/eslint-plugin-react-hooks/lints/unsupported-syntax docs}
113
+ */
114
+ "react-hooks/unsupported-syntax": "error",
92
115
  // don't force .jsx extension
93
116
  "react/jsx-filename-extension": "off",
94
117
  // In TS you must use the Fragment syntax instead of the shorthand
package/package.json CHANGED
@@ -3,15 +3,15 @@
3
3
  "description": "Turo eslint configuration for react",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@open-turo/eslint-config-typescript": "18.1.30",
6
+ "@open-turo/eslint-config-typescript": "18.1.31",
7
7
  "eslint-plugin-jsx-a11y": "6.10.2",
8
8
  "eslint-plugin-react": "7.37.5",
9
9
  "eslint-plugin-react-hooks": "7.0.1",
10
10
  "globals": "17.0.0",
11
- "typescript-eslint": "8.52.0"
11
+ "typescript-eslint": "8.53.0"
12
12
  },
13
13
  "devDependencies": {
14
- "@types/react": "19.2.7",
14
+ "@types/react": "19.2.8",
15
15
  "eslint": "9.39.2",
16
16
  "jest": "30.2.0",
17
17
  "prettier": "3.7.4",
@@ -48,5 +48,5 @@
48
48
  "access": "public"
49
49
  },
50
50
  "repository": "https://github.com/open-turo/eslint-config-react",
51
- "version": "18.0.8"
51
+ "version": "19.0.0"
52
52
  }
package/recommended.cjs CHANGED
@@ -49,6 +49,11 @@ module.exports = {
49
49
  * {@link https://react.dev/reference/eslint-plugin-react-hooks/lints/incompatible-library docs}
50
50
  */
51
51
  "react-hooks/incompatible-library": "error",
52
+ /**
53
+ * Technically an undocumented rule, this rule surfaces in syntax that causes the React Compiler to de-opt.
54
+ * Raising errors increases visibility into whether a component/hook as written cannot be optimized.
55
+ */
56
+ "react-hooks/todo": "error",
52
57
  /**
53
58
  * Not a rule we expect to see, but all other rules are set to "error", and so we set this one to "error" too (to require // eslint-disable)
54
59
  *
@@ -8035,6 +8035,9 @@ exports[`validate config the legacy recommended config is correct 1`] = `
8035
8035
  "react-hooks/static-components": [
8036
8036
  "error",
8037
8037
  ],
8038
+ "react-hooks/todo": [
8039
+ "error",
8040
+ ],
8038
8041
  "react-hooks/unsupported-syntax": [
8039
8042
  "error",
8040
8043
  ],