Is there an existing issue for this?
No.
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
.tsx file 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 warning
Suggested fix
Add to .oxlintrc.json rules:
"react/react-in-jsx-scope": "off"
Environment
Is there an existing issue for this?
No.
Current behavior
After PR #8677 (replace eslint with oxlint), any commit that touches a JSX/TSX file fails the pre-commit hook:
This blocks all local development commits on JSX files.
Expected behavior
Commits should succeed. React 17+ uses the automatic JSX runtime, so
import Reactis not required and thereact-in-jsx-scoperule should be disabled.Root cause
.oxlintrc.jsonenables thereactplugin withcorrectness: warn, which activatesreact-in-jsx-scope. Thelint-stagedconfig runsoxlint --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
pnpm install.tsxfile containing JSXgit commit→ pre-commit hook failsMinimal reproduction:
Suggested fix
Add to
.oxlintrc.jsonrules:Environment