feat(react)!: extract React Router relaxations into an optional group - #42
Merged
Conversation
`react` shipped a block scoped to `**/routes/**/*.tsx` that turned
`no-empty-pattern` off. That glob is not unique to React Router, since
TanStack Router uses a `routes/` directory too, so a project on any other
file-based router had the rule silently disabled across its whole route
tree with nothing in the composed config explaining why.
The relaxation moves to a new opt-in `reactRouter` block, spread after
`react`. Unlike `storybook` and `playwright`, which only add rules, this
block is subtractive, which is why making it opt-in is a breaking change:
React Router consumers must add the spread to keep current behavior.
Verified against GAIA's real tree: `({}: Route.ComponentProps)` errors
outside `routes/` and is suppressed inside it, so the exemption is
load-bearing rather than vestigial.
Also removes two dead config entries found while auditing the composition.
Neither changes any effective rule:
- `react/display-name` was set to `off` in the route block, but
`airbnb/config/react` already sets it to `off` for every file.
- The `typescript/only-throw-error` block disabled that rule for `hooks/`,
`routes/`, and `sessions.server/`, but `typescript/config` already
disables it globally for `**/*.ts?(x)`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MN1TCLUXUHLv9PBPBaL3fg
Merged
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.
What
reactshipped a block scoped to**/routes/**/*.tsxthat turnedno-empty-patternoff. That glob is not unique to React Router, since TanStack Router uses aroutes/directory too, so a project on any other file-based router had the rule silently disabled across its whole route tree with nothing in the composed config explaining why.The relaxation moves into a new opt-in
reactRouterblock:Why this is a major
Unlike
storybookandplaywright, which only ever add rules, this block is subtractive. Making a subtractive block opt-in is inherently breaking: React Router consumers must add the spread to keep current behavior. Migration is that one line, and a project that never writes({}: Route.ComponentProps)sees no new errors either way.Verification
Measured against GAIA's real tree rather than assumed:
({}: Route.ComponentProps)errors outsideroutes/and is suppressed inside it, so the exemption is load-bearing rather than vestigial.no-empty-patternforced on acrossapp/routesreports zero violations today, so GAIA's own upgrade is a no-op.react, or widening its glob, fails a test instead of quietly relaxing a rule.Dead config removed
Two entries in the blocks being touched, both verified to change no effective rule anywhere:
react/display-namewas set tooffin the route block, butairbnb/config/reactalready sets itofffor every file.typescript/only-throw-errorblock disabled that rule forhooks/,routes/, andsessions.server/, buttypescript/configalready disables it globally for**/*.ts?(x).Notes
The
/.react-router/**glob stays in theignoresdefaults. It names a directory that only exists in a React Router project, so it costs other projects nothing, while moving it would break React Router consumers who miss the new spread.A TanStack Router group (wrapping
@tanstack/eslint-plugin-router) is deliberately not in this PR. It is purely additive, so it can land as a minor without a migration.An audit of the whole composed config turned up ~28 further dead rule entries beyond the two removed here. Out of scope for this PR; will be raised separately.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MN1TCLUXUHLv9PBPBaL3fg