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

   Removes ESLint from the UI. oxlint now runs every rule ESLint ran, except 
two that are dropped, so `pnpm lint`, `lint:fix` and the prek hook run oxlint 
only.
   
   Until #76931 merges, this diff also shows its commits. Only the last commit 
belongs here: 
[f583d1c](https://github.com/apache/airflow/pull/NUM5/commits/f583d1cfda3af028f03dd5ed750dd24002e8119d).
   
   ### Stack
   
   This PR is part of a stack moving the UI from Prettier and ESLint to oxfmt 
and oxlint. Each open PR targets `main` and includes the commits of the open 
PRs before it, so review the PRs in order. Once a PR merges, the next one is 
rebased onto `main`.
   
   | Order | PR | Purpose |
   |---|---|---|
   | 1 | #76472 (merged) | Replace Prettier with oxfmt |
   | 2 | #76477 (merged) | Tidy the ESLint config before the oxlint move |
   | 3 | #76491 (merged) | Move most lint rules from ESLint to oxlint |
   | 4 | #76931 | Move the type-aware rules from typescript-eslint to oxlint 
(tsgolint) |
   | 5 | #NUM5 | Drop ESLint: the last rules run in oxlint as JS plugins or 
built-ins |
   | 6 | #NUM6 | Sync pnpm to 10.34.9 so local and Dependabot lockfiles match |
   | 7 | Not opened yet | Upgrade `typescript` to 7, once ESLint is gone and 
`pnpm codegen` supports it |
   
   
   ### Where the last 16 ESLint rules go
   - **12 run as their original plugins** through oxlint's `jsPlugins`, with 
the same options:
     - `eslint-plugin-react`: `destructuring-assignment`, `jsx-max-depth`, 
`jsx-no-leaked-render`, `no-deprecated`, `prefer-read-only-props`.
     - `eslint-plugin-unicorn`: `better-regex`, `consistent-destructuring`, 
`consistent-function-scoping`, `no-unnecessary-polyfills`, 
`no-useless-switch-case`, `prefer-dom-node-dataset`.
     - `@typescript-eslint/eslint-plugin`: `no-invalid-this`.
   
     oxlint reserves the `react`, `unicorn` and `typescript` names for its 
built-in plugins, so these load as `react-js`, `unicorn-js` and 
`typescript-js`. The one `eslint-disable` comment naming one of them is 
renamed. The override sets `env.browser` so the plugins' scope analysis knows 
`globalThis`.
   - **2 move to oxlint built-ins**: `no-unreachable-loop` and 
`no-useless-assignment`, both still nursery in oxlint.
   - **2 are dropped**: neither reports anything in the codebase today.
     - `@typescript-eslint/naming-convention` only runs under 
typescript-eslint's own parser, so it fails as a JS plugin.
     - `require-atomic-updates` is core ESLint and prone to false positives. 
ESLint removed it from its recommended set.
   
   This also covers the four rules #76491 left in ESLint (`jsx-max-depth`, 
`prefer-dom-node-dataset`, `consistent-function-scoping`, 
`no-useless-switch-case`): the original implementations run, so they report 
nothing new. Switching them to oxlint's built-in versions can be a follow-up.
   
   ### Removed
   - `eslint.config.js`, `rules/{core,levels,react,typescript,unicorn}.js` and 
`rules/plugin-patch.d.ts`.
   - `eslint`, `typescript-eslint`, `@typescript-eslint/parser`, 
`@eslint/compat`, `eslint-plugin-oxlint`, `eslint-plugin-jsx-a11y`, 
`eslint-plugin-react-hooks` and `eslint-plugin-react-refresh`. oxlint already 
ran their rules natively.
   - The ESLint step in `scripts/ci/prek/ts_compile_lint_ui.py`, and the ESLint 
mentions in the hook description, 
`contributing-docs/15_node_environment_setup.rst` and the UI README's Vite 
boilerplate.
   - The devcontainers recommend the oxc VS Code extension instead of the 
ESLint one.
   
   The plugins oxlint loads stay: perfectionist, `@stylistic/eslint-plugin`, 
i18next, react, unicorn and `@typescript-eslint/eslint-plugin`. 
`@typescript-eslint/utils` stays for the JSDoc types in the local `airflow` 
plugin. The local rule's test now uses oxlint's `RuleTester`.
   
   The simple auth manager UI and the `dev/react-plugin-tools` template still 
use ESLint; they are out of scope here.
   
   ### TypeScript
   `typescript` stays on 6. Upgrading to 7 is a separate PR. 
`@typescript-eslint/eslint-plugin` still declares `typescript <6.1.0` as a 
peer, which would only be a peer-dependency warning after the upgrade.
   
   ### Coverage
   - **Whole package:** `oxlint` reports 0 problems, as ESLint and oxlint did 
before.
   - **Probe files:** violations of each moved rule give the same rule IDs 
under this PR's oxlint as under ESLint on #76931. `better-regex` and 
`prefer-dom-node-dataset` stayed silent on the probes in both.
   - **Local rule test:** the oxlint `RuleTester` version passes, and fails 
when a valid case is changed to an invalid one.
   
   ### Benchmarks: whole stack
   Before = the commit before #76472 (Prettier, ESLint runs every rule). After 
= this PR (oxfmt, oxlint runs every rule). `hyperfine -N --warmup 1`, M1 Max, 
Node 22.21.1. Load average was 20–54 during the runs, so wall times are 
inflated and noisy; CPU time (user + system) is steadier.
   
   | Run | Before | After |
   |---|---|---|
   | Full package: lint `--quiet` + format check, tsc left out (5 runs) | 110 s 
wall, 146 s CPU | 13 s wall, 27 s CPU |
   | prek hook path: 5 changed files, lint `--fix` + format `--write` (10 runs) 
| 11.4 s wall, 15.3 s CPU | 3.1 s wall, 5.7 s CPU |
   
   Medians. tsc runs the same way before and after and isn't included.
   
   ### Checks run
   - **Lint:** `pnpm lint` passes (oxlint, then tsc).
   - **Format:** `pnpm format:check` passes.
   - **Tests:** `pnpm test` under load average 24 had 14 failing files, 
including the timing-sensitive ones `main` also fails under load 
(`BackfillsDateFilter`, `DagsFilters`, `RequiredActionsRoute`). All 14 pass 
when re-run on their own.
   - **Build:** `pnpm build` succeeds.
   - **prek:** `prek run --stage pre-commit` passes on the changed files.
   
   ---
   
   ##### 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