@smartive/eslint-config 8.0.0-next.2 → 8.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 +38 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,6 +91,44 @@ ESLint React covers most of what is turned off. What is genuinely lost:
|
|
|
91
91
|
| `react-hooks/config`, `react-hooks/gating`, `react-hooks/incompatible-library`, `react-hooks/preserve-manual-memoization` | none — ESLint React does not implement these React Compiler rules |
|
|
92
92
|
| `react/no-unescaped-entities` | none |
|
|
93
93
|
|
|
94
|
+
## Upgrading from v7
|
|
95
|
+
|
|
96
|
+
Expect new errors on code that passed before. ESLint React's `recommended-type-checked` preset is
|
|
97
|
+
considerably broader than the `eslint-plugin-react` set it replaces, so upgrading turns on **44 checks
|
|
98
|
+
that had no predecessor** — 14 as `error`, 30 as `warn`. These are new findings in unchanged code, not
|
|
99
|
+
regressions.
|
|
100
|
+
|
|
101
|
+
The 14 that fail a build:
|
|
102
|
+
|
|
103
|
+
| Rule | Catches |
|
|
104
|
+
| ----------------------------------------------------- | ------------------------------------------------------------- |
|
|
105
|
+
| `@eslint-react/no-leaked-conditional-rendering` | `{count && <Foo />}` rendering `0`, or crashing on a non-node |
|
|
106
|
+
| `@eslint-react/no-nested-component-definitions` | components declared inside other components |
|
|
107
|
+
| `@eslint-react/no-nested-lazy-component-declarations` | `lazy()` called inside a component |
|
|
108
|
+
| `@eslint-react/jsx-no-key-after-spread` | `key` placed after `{...props}` |
|
|
109
|
+
| `@eslint-react/jsx-no-namespace` | namespaced JSX names |
|
|
110
|
+
| `@eslint-react/jsx-no-children-prop-with-children` | `children` passed both as prop and as JSX children |
|
|
111
|
+
| `@eslint-react/dom-no-void-elements-with-children` | children on `<img>`, `<br>` and friends |
|
|
112
|
+
| `@eslint-react/dom-no-flush-sync` | `flushSync`, which forces a synchronous re-render |
|
|
113
|
+
| `@eslint-react/dom-no-use-form-state` | the removed `useFormState` |
|
|
114
|
+
| `@eslint-react/no-access-state-in-setstate` | reading `this.state` inside `setState` |
|
|
115
|
+
| `@eslint-react/rsc-function-definition` | invalid server-component function forms |
|
|
116
|
+
| `no-unassigned-vars` | declared, never assigned, still read |
|
|
117
|
+
| `no-useless-assignment` | a value overwritten before it is read |
|
|
118
|
+
| `preserve-caught-error` | rethrowing without passing `cause` |
|
|
119
|
+
|
|
120
|
+
The last three are core ESLint rules, new to `js.configs.recommended` in `@eslint/js` v10.
|
|
121
|
+
|
|
122
|
+
The 30 warnings cluster into a few families: effect-cleanup leaks
|
|
123
|
+
(`@eslint-react/web-api-no-leaked-timeout`, `-interval`, `-event-listener`, `-fetch`, and the two
|
|
124
|
+
observer rules), React 19 deprecations (`no-forward-ref`, `no-context-provider`, `no-use-context`,
|
|
125
|
+
`no-clone-element`, the `no-children-*` set), naming conventions (`naming-convention-context-name`,
|
|
126
|
+
`-id-name`, `-ref-name`) and `@eslint-react/no-array-index-key`.
|
|
127
|
+
|
|
128
|
+
Rule ids also changed, so existing suppressions stop working — silently, since an `eslint-disable`
|
|
129
|
+
naming an unknown rule is simply inert. Anything mentioning `react/*`, `react-hooks/*` or `import/*`
|
|
130
|
+
needs rewriting to `@eslint-react/*`, `import-x/*` or `smartive/*`.
|
|
131
|
+
|
|
94
132
|
## Custom rules
|
|
95
133
|
|
|
96
134
|
### `smartive/forbid-component-props`
|