Take ESLint 10 and react-hooks 7, and drop two dead assignments they found - #188
Merged
Merged
Conversation
…found Supersedes #180 (eslint), #182 (@eslint/js) and #179 (eslint-plugin-react-hooks). None of the three could merge alone: @eslint/js 10 peer-depends on eslint ^10, so they move together. Nothing else blocked them. typescript-eslint 8.67 already accepts eslint ^10.0.0, and react-hooks 7 accepts it too, so the config needed no changes. ESLint 10 wants Node ^20.19 || ^22.13 || >=24, which CI only satisfies because of the Node 22 move in the previous commit. `no-useless-assignment` is new in ESLint 10's recommended set and found two real dead assignments, both the same shape: let next = current; switch (event.key) { case ...: next = ...; break; // every arm assigns default: return; // or returns } The seed value can never be read. Both are now declared without an initialiser, so the compiler enforces "every path assigns or returns" rather than a plausible-looking default hiding a missing case. tsc accepts it, which is the proof that the property actually holds. Verified the rule set still fires rather than trusting a green exit — a throwaway probe file with a conditional hook, an `any`, and a bad dependency array produced all three diagnostics: error Unexpected any @typescript-eslint/no-explicit-any error React Hook "useState" is called conditionally react-hooks/rules-of-hooks warning useEffect has a missing dependency react-hooks/exhaustive-deps Lint is 0 errors / 3 warnings, the same three pre-existing exhaustive-deps warnings as before. 94 tests and the build pass.
This was referenced Aug 17, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #180 (eslint), #182 (@eslint/js) and #179 (eslint-plugin-react-hooks).
None of the three could merge alone —
@eslint/js10 peer-depends oneslint@^10, so they move together.Nothing else was blocking them
eslint: ^8.57.0 || ^9.0.0 || ^10.0.0eslint: … || ^10.0.0node: ^20.19.0 || ^22.13.0 || >=24The config needed no changes. Note the last row: on the old Node 20 runner this bump would have been blocked too, for the same reason jsdom was.
What the upgrade found
no-useless-assignmentis new in ESLint 10's recommended set, and it caught two real dead assignments — same shape in both places:The seed value can never be read. Both are now declared without an initialiser, so the compiler enforces "every path assigns or returns" instead of a plausible-looking default quietly absorbing a missing case.
tscaccepting it is the proof that the property actually holds.Verification
The rule set still fires — checked rather than inferred from a green exit. A throwaway probe file containing a conditional hook, an
any, and a bad dependency array produced all three diagnostics:That matters here because a major-version bump that silently stopped registering the plugin would still exit 0, and
react-hooksis the rule set that catches the stale-closure bugs this project has actually shipped.Lint: 0 errors, 3 warnings — the same three pre-existing
exhaustive-depswarnings as before. 94 tests and the build pass.Still blocked
#134 (TypeScript 7) is unaffected. typescript-eslint 8.67 caps TypeScript at
>=4.8.4 <6.1.0, so no ESLint-side bump helps it.