bbovenzi opened a new pull request, #76491:
URL: https://github.com/apache/airflow/pull/76491

   Moves most of the UI's lint rules from ESLint to 
[oxlint](https://oxc.rs/docs/guide/usage/linter). ESLint stays for the rules 
oxlint can't run yet.
   
   **Stacked on #76477, which is stacked on #76472.** Only the last commit 
belongs to this PR.
   
   ### What moves
   - oxlint runs **283 of the 342** enabled rules: built-in versions of the 
core, typescript, react, react-hooks, jsx-a11y and unicorn rules, plus 
perfectionist, `@stylistic`, i18next and the local `airflow` plugin through 
`jsPlugins`.
   - ESLint keeps **59 rules**:
     - 44 type-aware typescript-eslint rules (need TypeScript 7 for oxlint's 
type-aware mode)
     - `naming-convention` and a few others oxlint hasn't implemented
     - 4 nursery rules
   - `eslint-plugin-oxlint` turns off in ESLint every rule oxlint runs. The 
JS-plugin rules are removed from the ESLint config by hand, since that plugin 
only knows oxlint's built-in rules.
   - `pnpm lint` is `oxlint --quiet && eslint --quiet && tsc`. The prek hook 
runs `oxlint --fix` before `eslint --fix`.
   
   ### Keeping what gets reported the same
   The config is `@oxlint/migrate` output plus these fixes:
   - **Core rules scope:** they stay on `rules/`, `src/` and root files. 
Migrate's glob matched at any depth, adding 213 errors in `tests/`.
   - **i18next:** still skips `*.test.tsx`, via `excludeFiles`.
   - **`jsx-curly-brace-presence`:** `propElementValues: "ignore"`, ESLint's 
default.
   - **`id-length`:** `checkGeneric: false`. ESLint didn't count type 
parameters.
   
   Four rules report code ESLint never flagged. They're **off in oxlint for 
now**, but ESLint still runs them, so coverage doesn't change. Follow-ups:
   
   | Rule | Hits | Why |
   |---|---|---|
   | `react/jsx-max-depth` | 34 in 9 files | ESLint's implementation never 
reported these |
   | `unicorn/prefer-dom-node-dataset` | 14 | switching isn't mechanical: 
`Number(getAttribute(…))` gives 0 for a missing attribute, `dataset` gives NaN |
   | `unicorn/consistent-function-scoping` | 5 | 2 of them flag exported 
top-level functions |
   | `unicorn/no-useless-switch-case` | 3 | those `case null:` lines satisfy 
ESLint's type-aware `switch-exhaustiveness-check` |
   
   Five source files change (+16/−8 lines), each where oxlint reports a site 
ESLint accepted:
   - **`react/no-danger`:** oxlint also checks components, so the two "Trusting 
KaTeX/mermaid" comments become `oxlint-disable-next-line react/no-danger -- …`.
   - **`unicorn/prefer-spread`:** inline disables, because the autofix would 
drop the optional chain in `x?.slice().reverse()`.
   - **`id-length`:** `n` → `value` in one function type.
   - **i18next:** a disable/enable block around the trademark link in 
`Nav.tsx`. oxlint reports the text line, not the `<a>` line.
   
   ESLint's unused-disable-directive reporting is off: ESLint would call the 
directives of oxlint-run rules unused, and `--fix` deleted them. A small 
plugins-only block keeps disable comments that name i18next and perfectionist 
rules resolvable in ESLint.
   
   ### Versions
   `oxlint` 1.90.0 and `eslint-plugin-oxlint` 1.90.0, the newest releases older 
than the package's `minimumReleaseAge`. Dependabot's `oxc` group now covers 
`oxlint*`.
   
   ### Benchmarks
   To do. The first local baseline ran on an overloaded machine (load average 
40+), so it's discarded. Before/after numbers will be added from a quiet 
machine and Breeze, using the same method as #76472.
   
   ### Checks run
   - **Lint:** `pnpm lint` passes (oxlint, then ESLint, then tsc).
   - **Tests:** `pnpm test` passes (277 files, 2369 passed, 4 skipped).
   - **Build:** `pnpm build` succeeds.
   - **prek:** all hooks pass on the changed files, including 
`ts-compile-lint-ui`.
   - **Probe file:** one violation per moved rule family, each still reported 
by oxlint (perfectionist, stylistic, i18next, `airflow/*`, core, react).
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to