-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
Is there an existing issue for this?
No.
- I have searched the existing issues
Current behavior
After PR #8677 (replace eslint with oxlint), any commit that touches a JSX/TSX file fails the pre-commit hook:
✖ pnpm exec oxlint --fix --deny-warnings:
! eslint-plugin-react(react-in-jsx-scope): `React` must be in scope when using JSX.
This blocks all local development commits on JSX files.
Expected behavior
Commits should succeed. React 17+ uses the automatic JSX runtime, so import React is not required and the react-in-jsx-scope rule should be disabled.
Root cause
.oxlintrc.json enables the react plugin with correctness: warn, which activates react-in-jsx-scope. The lint-staged config runs oxlint --fix --deny-warnings, promoting all warnings to errors.
The previous ESLint config had react/react-in-jsx-scope: off, but this was not carried over to .oxlintrc.json.
Steps to reproduce
- Fresh clone,
pnpm install - Edit any
.tsxfile containing JSX git commit→ pre-commit hook fails
Minimal reproduction:
pnpm exec oxlint --fix --deny-warnings apps/web/app/root.tsx
# exits 1 with react-in-jsx-scope warningSuggested fix
Add to .oxlintrc.json rules:
"react/react-in-jsx-scope": "off"Environment
- oxlint 1.51.0
- Node 22
- macOS / Linux
- Introduced in PR fix: replace eslint with oxlint #8677
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels