Skip to content

fix: disable react-in-jsx-scope rule in oxlint config#8682

Open
darkingtail wants to merge 1 commit intomakeplane:previewfrom
darkingtail:fix/oxlint-react-in-jsx-scope
Open

fix: disable react-in-jsx-scope rule in oxlint config#8682
darkingtail wants to merge 1 commit intomakeplane:previewfrom
darkingtail:fix/oxlint-react-in-jsx-scope

Conversation

@darkingtail
Copy link

@darkingtail darkingtail commented Mar 3, 2026

Summary

  • Add "react/react-in-jsx-scope": "off" to .oxlintrc.json
  • React 17+ uses automatic JSX runtime, explicit import React is not required
  • This rule was disabled in the previous ESLint config but was not carried over when migrating to OxLint in fix: replace eslint with oxlint #8677

Problem

After #8677, the pre-commit hook (oxlint --fix --deny-warnings) fails on every commit that touches a JSX/TSX file:

! eslint-plugin-react(react-in-jsx-scope): `React` must be in scope when using JSX.

This blocks all local development commits.

Fix

One-line change in .oxlintrc.json:

"react/react-in-jsx-scope": "off"

Fixes #8681

Summary by CodeRabbit

  • Chores
    • Updated linter configuration settings.

After makeplane#8677 replaced ESLint with OxLint, the react-in-jsx-scope rule
was not disabled. This causes all commits touching JSX files to fail
the pre-commit hook (oxlint --deny-warnings).

React 17+ uses automatic JSX runtime so explicit React imports are
not required.

Fixes makeplane#8681
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9d688f and 1666ed4.

📒 Files selected for processing (1)
  • .oxlintrc.json

📝 Walkthrough

Walkthrough

Updates .oxlintrc.json to disable the react/react-in-jsx-scope rule that was blocking pre-commit hooks on JSX/TSX files. The rule was present in the previous ESLint config but omitted during migration to oxlint.

Changes

Cohort / File(s) Summary
Oxlint Configuration
.oxlintrc.json
Adds react/react-in-jsx-scope: off to the rules section to resolve pre-commit hook failures on JSX files. Reformats no-unused-vars rule from inline to multi-line structure with equivalent configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A config tweak, so small and neat,
React's import no longer needs to meet
The linter's strict demands—
Modern JSX in our hands!
No more hook failures, just commits that fly. 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: disabling the react-in-jsx-scope rule in the oxlint configuration.
Description check ✅ Passed The description covers the problem, solution, and context but is missing the required 'Type of Change' and 'Test Scenarios' sections from the template.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue #8681 by adding the react-in-jsx-scope rule disablement to .oxlintrc.json as requested.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to fixing the linked issue; only the .oxlintrc.json file is modified with the specific rule disablement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: oxlint pre-commit hook fails on all JSX files — missing react-in-jsx-scope: off

2 participants