@open-turo/eslint-config-react 25.0.3-pr-538.740.1.1 → 26.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,37 @@
|
|
|
1
|
+
# Breaking changes in v26
|
|
2
|
+
|
|
3
|
+
This release turns `off` the `prop-types` related `eslint-plugin-react` rules that were enabled. We no longer support the [`prop-types`](https://www.npmjs.com/package/prop-types) library: React stopped reporting `propTypes` checks in v18.3 and [removed support entirely in v19](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops).
|
|
4
|
+
|
|
5
|
+
The following rules are now `off` (previously `error`):
|
|
6
|
+
|
|
7
|
+
- `react/prop-types`
|
|
8
|
+
- `react/sort-prop-types`
|
|
9
|
+
|
|
10
|
+
This relaxes the config and will not raise new errors. However, any `// eslint-disable` directives targeting these rules are now unused, and will be reported if `reportUnusedDisableDirectives` is enabled. Remove them, along with any remaining `prop-types` usage and the `prop-types` dependency.
|
|
11
|
+
|
|
12
|
+
Below is the full list of changes:
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
diff --git a/test/__snapshots__/test.spec.js.snap b/test/__snapshots__/test.spec.js.snap
|
|
16
|
+
index ff3b253..a3b08a9 100644
|
|
17
|
+
--- a/test/__snapshots__/test.spec.js.snap
|
|
18
|
+
+++ b/test/__snapshots__/test.spec.js.snap
|
|
19
|
+
@@ -2108,7 +2108,7 @@ exports[`validate config the flat config is correct for index.mjs 1`] = `
|
|
20
|
+
0,
|
|
21
|
+
],
|
|
22
|
+
"react/prop-types": [
|
|
23
|
+
- 2,
|
|
24
|
+
+ 0,
|
|
25
|
+
],
|
|
26
|
+
"react/react-in-jsx-scope": [
|
|
27
|
+
0,
|
|
28
|
+
@@ -2120,7 +2120,7 @@ exports[`validate config the flat config is correct for index.mjs 1`] = `
|
|
29
|
+
2,
|
|
30
|
+
],
|
|
31
|
+
"react/sort-prop-types": [
|
|
32
|
+
- 2,
|
|
33
|
+
+ 0,
|
|
34
|
+
],
|
|
35
|
+
"react/state-in-constructor": [
|
|
36
|
+
0,
|
|
37
|
+
```
|
package/index.mjs
CHANGED
|
@@ -122,9 +122,10 @@ const config = function config(options = {}) {
|
|
|
122
122
|
"react/jsx-sort-props": "error",
|
|
123
123
|
// Allow emotion css prop
|
|
124
124
|
"react/no-unknown-property": ["error", { ignore: ["css"] }],
|
|
125
|
+
"react/prop-types": "off",
|
|
125
126
|
// We don't need default props on TS components
|
|
126
127
|
"react/require-default-props": "off",
|
|
127
|
-
"react/sort-prop-types": "
|
|
128
|
+
"react/sort-prop-types": "off",
|
|
128
129
|
// State initialization can be in the constructor or via class fields
|
|
129
130
|
"react/state-in-constructor": "off",
|
|
130
131
|
// This allows static properties to be placed within the class declaration
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -2111,7 +2111,7 @@ exports[`validate config the flat config is correct for index.mjs 1`] = `
|
|
|
2111
2111
|
0,
|
|
2112
2112
|
],
|
|
2113
2113
|
"react/prop-types": [
|
|
2114
|
-
|
|
2114
|
+
0,
|
|
2115
2115
|
],
|
|
2116
2116
|
"react/react-in-jsx-scope": [
|
|
2117
2117
|
0,
|
|
@@ -2123,7 +2123,7 @@ exports[`validate config the flat config is correct for index.mjs 1`] = `
|
|
|
2123
2123
|
2,
|
|
2124
2124
|
],
|
|
2125
2125
|
"react/sort-prop-types": [
|
|
2126
|
-
|
|
2126
|
+
0,
|
|
2127
2127
|
],
|
|
2128
2128
|
"react/state-in-constructor": [
|
|
2129
2129
|
0,
|
|
Binary file
|