Skip to content

chore(eslint): enable react/jsx-uses-react and apply prettier formatting#468

Merged
mrholek merged 1 commit into
mainfrom
chore/eslint-jsx-uses-react
Jun 13, 2026
Merged

chore(eslint): enable react/jsx-uses-react and apply prettier formatting#468
mrholek merged 1 commit into
mainfrom
chore/eslint-jsx-uses-react

Conversation

@mrholek

@mrholek mrholek commented Jun 13, 2026

Copy link
Copy Markdown
Member

Context

yarn lint currently fails hard on main (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 disables react/jsx-uses-react and react/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 mandatory import React was reported as an unused variable (@typescript-eslint/no-unused-vars) in ~135 files — the bulk of the error count.

Changes

  • Re-enable react/jsx-uses-react: 'error' so the required React import counts as used.
  • Apply prettier --write to clear the prettier/prettier formatting violations (whitespace, trailing commas, missing final newlines).

Result

  • eslint: 400 → 84 errors (0 prettier errors remain).
  • The remaining 84 errors need real code changes (no-unused-expressions, no-explicit-any, two removeEventListener-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

  • Full test suite: 127 suites / 358 tests green, no snapshot changes.
  • yarn lib:build succeeds.
  • Diff is formatting-only (26 files, +79/−61).

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.
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.

1 participant