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

   Upgrades the UI's `tsc` to TypeScript 7, so `pnpm lint` and the prek hook 
type-check with the same TypeScript as the type-aware lint rules.
   
   Until #76931, #77218 and #77219 merge, this diff also shows their commits. 
Only the last commit belongs here: 
[bfcc63f](https://github.com/apache/airflow/pull/NUM7/commits/bfcc63f1869fdee81ed200a9e08f9b7a8e629011).
   
   ### 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 | #77218 | Drop ESLint: the last rules run in oxlint as JS plugins or 
built-ins |
   | 6 | #77219 | Sync pnpm to 10.34.9 so local and Dependabot lockfiles match |
   | 7 | #NUM7 | Upgrade the UI to TypeScript 7, keeping TypeScript 6 for tools 
that need its API |
   
   
   ### Why
   Since #76931, the type-aware rules run on TypeScript 7 through tsgolint, 
while `tsc` still ran TypeScript 6. The two could disagree about a type, which 
came up in review there. This closes that gap.
   
   ### How
   TypeScript 7 ships no JS API; the release notes say one is expected in 7.1. 
Two tools here still need the TypeScript 6 API:
   - `pnpm codegen`: `@7nohe/openapi-react-query-codegen` and 
`@hey-api/openapi-ts` import `typescript` to build the client.
   - oxlint's JS plugins: `@typescript-eslint/eslint-plugin` (for 
`no-invalid-this`) refuses to load on TypeScript 7.
   
   So this follows [the TypeScript 7 release notes' side-by-side 
setup](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0):
   - `typescript` is an alias for `@typescript/typescript6`, which re-exports 
the TypeScript 6 API. Tools that import or peer on `typescript` keep getting 6.
   - `@typescript/native` is an alias for `typescript@^7.0.2` and provides the 
`tsc` binary. `tsc6` remains available.
   
   No tsconfig changes were needed: the TypeScript 6 deprecations were already 
cleared in #76931.
   
   Dependabot's `typescript` group now also matches `@typescript/*`. Dependabot 
may not bump aliased packages; if it doesn't, these need manual bumps, as 
before.
   
   The alias can go once codegen and typescript-eslint support TypeScript 7.1's 
API.
   
   ### Checks run
   - **Types:** `tsc` (7.0.2) reports 0 errors on `tsconfig.app.json` and 
`tsconfig.node.json`, as `tsc6` does. On `tsconfig.dev.json`, which `pnpm lint` 
doesn't check, both report the same errors.
   - **Codegen:** `pnpm codegen` produces a byte-identical `openapi-gen/`.
   - **Lint:** `pnpm lint` (oxlint with its JS plugins, then `tsc`) passes.
   - **Format / build:** `pnpm format:check` and `pnpm build` pass.
   - **Tests:** the local oxlint rule test passes. The rest of the UI tests 
don't use TypeScript's compiler.
   - **prek:** `prek run --stage pre-commit` passes on the changed files.
   
   ### Benchmark
   `hyperfine -N --warmup 1 --runs 5`, `tsc -p tsconfig.app.json`, M1 Max, Node 
22.21.1. Load average was 50–96, so only the ratio is meaningful:
   
   | | Time | Memory |
   |---|---|---|
   | TypeScript 6 (`tsc6`) | 31.9 s ± 6.7 | 1.2 GiB |
   | TypeScript 7 (`tsc`) | 7.3 s ± 1.3 | 2.0 GiB |
   
   ---
   
   ##### 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