chore(eslint): enable react/jsx-uses-react and apply prettier formatting#468
Merged
Conversation
The flat config extends the jsx-runtime preset, which turns off react/jsx-uses-react and react/react-in-jsx-scope. The library still compiles with the classic JSX transform (tsconfig "jsx": "react"), so the mandatory React import was being flagged as an unused variable across the codebase. Re-enable react/jsx-uses-react so the import counts as used, and apply prettier autofix to clear the formatting violations. Reduces eslint from 400 to 84 errors; the remaining ones require code changes and are left for follow-up.
This was referenced Jun 13, 2026
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.
Context
yarn lintcurrently fails hard onmain(400 errors). This is the first, purely mechanical step toward a clean lint gate — no component logic is touched.Problem
The flat config extends
eslintPluginReact.configs.flat['jsx-runtime'], which disablesreact/jsx-uses-reactandreact/react-in-jsx-scope. That preset is meant for the automatic JSX runtime, but the library still compiles with the classic transform (tsconfig"jsx": "react"). With the rule off, the mandatoryimport Reactwas reported as an unused variable (@typescript-eslint/no-unused-vars) in ~135 files — the bulk of the error count.Changes
react/jsx-uses-react: 'error'so the required React import counts as used.prettier --writeto clear theprettier/prettierformatting violations (whitespace, trailing commas, missing final newlines).Result
no-unused-expressions,no-explicit-any, tworemoveEventListener-with-inline-arrow bugs, a few react-hooks v7 findings) and are left for dedicated follow-up PRs before a lint step is added to CI.Verification
yarn lib:buildsucceeds.