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

   Second step of the UI move from ESLint/Prettier to oxlint/oxfmt. It cleans 
up the ESLint config so the next step (moving most rules to oxlint) is easy to 
review: every rule left does something, and the custom checks use only plugin 
APIs oxlint can load.
   
   **Stacked on #76472** (Replace Prettier with oxfmt). Until that merges, this 
diff also shows its two commits. Only the last commit belongs to this PR.
   
   **Lint behaviour does not change.** I ran `eslint -f json` over the whole UI 
before and after: the same 30 messages on the same lines, warnings included. 
The only thing gone is the 140 `i18n/check-translations-completeness` warnings, 
which this PR drops on purpose. `eslint --print-config` on sample `.tsx`, `.ts` 
and `.js` files differs only in the rules listed below. A scratch file with one 
violation of each moved check gets every one reported.
   
   ### Removed dead config
   - 70 `"off"` entries for rules that nothing enables (66 in the 
typescript-eslint `off(...)` list, 4 more typescript-eslint offs, `sort-keys`, 
`unicorn/no-null`), plus the `off.js` helper and the `OFF` level.
   - Core `no-empty-function`: it reported every hit a second time next to 
`@typescript-eslint/no-empty-function`.
   - `no-octal`: legacy octal literals do not parse in modules. 
`react/sort-prop-types`: the UI has no PropTypes.
   - Unused devDependencies `@eslint/js` and `@tanstack/eslint-plugin-query`. 
(`ts-morph` and `web-worker` look unused, but codegen and elkjs need them.)
   
   ### JSON checks leave ESLint
   oxlint does not lint JSON.
   - Key sorting for the locale files (`jsonc/sort-keys`, natural order) moves 
into the `check-i18n-json` prek hook, which already rewrites every locale file. 
The hook uses the same sort key as `breeze ui`. It matches the 
`natural-compare` npm package on 2,209 tricky key pairs, and it leaves every 
current locale file unchanged.
   - `i18n/check-translations-completeness` (warn-only) is dropped: `breeze ui 
check-translation-completeness` already reports missing keys in CI.
   - `eslint-plugin-jsonc` and `jsonc-eslint-parser` are removed. The 
`ts-compile-lint-ui` hook now passes only `.js`/`.ts`/`.tsx` files to ESLint.
   
   ### Local plugin
   `rules/airflow-plugin/` uses the shape both ESLint and oxlint `jsPlugins` 
load (`meta.name` + `rules`), with no runtime dependency on 
`@typescript-eslint/utils`:
   - `airflow/no-rem-in-props`: the former `rem/no-rem-in-props`. Its autofix 
used to write invalid JSX (`width={16px}`) and now writes a quoted value 
(`width="16px"`). This is the only behaviour change.
   - `no-restricted-syntax` selectors do not carry over to oxlint, so the three 
`React` selectors are replaced one-to-one:
     - `React.FC` / `React.FunctionComponent` / `React.VFC` → 
`@typescript-eslint/no-restricted-types` (built into oxlint).
     - `const Foo: FC = () => …` → `airflow/no-fc-components`. This stays 
limited to arrow-function declarations, as the old selector was, because the 
React plugin loaders (`PluginReactAction.tsx`, `ReactPlugin.tsx`) use `FC` as a 
type for loaded components. Banning `FC` everywhere would need code changes and 
can be its own rule PR.
     - Other `React.*` qualified types → `airflow/no-react-namespace-types`.
   - Each rule has an ESLint `RuleTester` test, which `pnpm test` (vitest) 
picks up.
   
   ### Checks run
   - UI: `pnpm lint`, `pnpm build` and `pnpm test` pass. In the full `pnpm 
test` run, `DagsList.test.tsx` and `DagsFilters.test.tsx` failed with "socket 
hang up"; both pass when run on their own.
   - `uv run --project scripts pytest scripts/tests/`, `dev/breeze` pytest, and 
the simple auth manager UI `pnpm test` pass.
   - `prek run --stage pre-commit` and `prek run --from-ref apache/main --stage 
manual` (with the documented skips) pass.
   
   ---
   
   ##### 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