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

   Makes every UI lint rule an error and runs oxlint with `--deny-warnings`, 
after fixing the 33 warnings `--quiet` was hiding.
   
   Until #77218, #77221 and #77264 merge, this diff also shows their commits. 
Only the last commit belongs here: 23a5dfa.
   
   ### 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 (merged) | Move the type-aware rules from typescript-eslint to 
oxlint (tsgolint) |
   | 5 | #77218 | Drop ESLint: the last rules run in oxlint as JS plugins or 
built-ins |
   | 6 | #77221 | Upgrade the UI to TypeScript 7, keeping TypeScript 6 for 
tools that need its API |
   | 7 | #77264 | Use oxlint's built-in rules for the last unicorn plugin rules 
|
   | 8 | #PR9 | Make every UI lint rule an error and fail on warnings |
   
   The pnpm sync (#77219) used to sit in this stack; it now targets `main` on 
its own.
   
   ### Why
   `pnpm lint` ran `oxlint --quiet`, so warn-level rules never failed: their 
hits stayed in the code, and nobody saw them unless they ran oxlint by hand. 
Now every rule in `.oxlintrc.json` is `"error"`, and `pnpm lint`, `pnpm 
lint:fix` and the prek hook pass `--deny-warnings` so a rule that defaults to 
warn can't slip through either.
   
   ### Fixes
   - **`react/only-export-components`** (24 hits in 10 files). Vite hot-swaps a 
component only when its file exports nothing but components. Otherwise saving 
the file reloads the page. The non-component exports move to their own files:
     - Dags list: the cell components move from `DagsListColumns` and 
`RecentTaskStateCountsColumn` to `DagsListCells.tsx`. The column builders 
become `.ts` files, and `getRowKey` moves to `dagsListRowKey.ts` so the cells 
and the list don't import each other.
     - Contexts and their hooks go to `.ts` files, and the providers to `.tsx`: 
`DagsListCountsContext`/`DagsListCountsProvider`, 
`PluginActionsContext`/`PluginActionsProvider`, `MenuContext`, and 
`useRowSelection` (hook) / `RowSelection` (provider and checkboxes).
     - Functions and constants: `loadPlugin` and `PluginProps` 
(`loadPlugin.ts`), `getFailingWatchersParams`, `RUN_TYPE_LEGEND_ORDER` and the 
test-only `preloadAppRoutes`.
   - **`prefer-named-capture-group`** (2 regexes): the mock task-instance route 
reads its parts from named groups; the whitespace split in `XComEntry` names 
its group.
   - **`typescript/no-non-null-assertion`**: `getRelativeTime` falls back to a 
named `SMALLEST_RELATIVE_TIME_UNIT` instead of `.at(-1)!`.
   - **`no-console`** and **`no-bitwise`**: disable comments where the code is 
deliberate, on the console spy in `testsSetup.ts` and the 
`compareDocumentPosition` bitmask in `DagsList.test.tsx`.
   
   `react/no-multi-comp`, `prefer-exponentiation-operator` and 
`prefer-object-spread` were also at warn with no hits; they're errors now.
   
   ### Checks run
   - **Lint:** `pnpm lint` passes with `--deny-warnings`; oxlint reports 0 
warnings and 0 errors.
   - **Format / build:** `pnpm format:check` and `pnpm build` pass.
   - **Tests:** `vitest run --changed` against the previous commit, under load 
average 41: 2393 of 2492 pass (94 skipped). Every failing file passes on its 
own, except 3 tests in `Trigger.test.tsx`, which fail the same way on `main`.
   - **prek:** the pre-commit hooks pass on the commit.
   - **Not checked:** hot refresh in a running dev server.
   
   ---
   
   ##### 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)
   


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