Repository navigation
build: suncalc 2, TypeScript 7, bun 1.4.2, and oxlint in place of ESLint - #30
Merged
Merged
Conversation
suncalc 1.9 -> 2.0.2 is the breaking one. 2.0 is ESM with named exports,
reports degrees instead of radians, and measures azimuth north-based
clockwise where 1.x measured it from south toward west. A mechanical
import fix would have compiled and shipped the sun rotated 180 degrees,
so lib/city/sun.ts flips both horizontal signs to match:
east: -cos(alt)*sin(az_south) -> cos(alt)*sin(az_north)
north: -cos(alt)*cos(az_south) -> cos(alt)*cos(az_north)
Checked against 1.9 over 360 sampled instants at Dresden: max deviation
1.0e-15, i.e. the rewrite is the same vector. What does change is that
2.0 applies atmospheric refraction, so the sun sits up to 0.70 deg
higher near the horizon (negligible when it is high) - a real accuracy
gain for golden-hour lighting and low-sun shadow length. suncalc now
ships its own types, so @types/suncalc is gone; the pin stays exact
because a silent float here rotates the sun rather than failing.
sun.test.ts gains a midwinter-noon case and narrows the now-nullable
sunrise.
Also:
- Drop @typescript/native-preview and run `tsc --noEmit`. It was a
frozen July daily build of the TS 7 preview, so three compilers
checked this repo and a green `verify` did not predict a green build.
One compiler now serves typecheck, `next build` and ESLint's typed
rules; it costs ~8 s. TS 7 stays out until typescript-eslint accepts
it (peer `typescript <6.1.0`).
- ESLint 9.39.4 -> 9.39.5 and Biome 2.5.0 -> 2.5.14 (clean, verified).
ultracite stays at 7.8.3: 7.12.0 enables ~10 new rule families for
451 violations, which is a style refactor, not a dependency bump.
- `eslint --max-warnings=0` now gates lint. The count was already 0.
- geotiff moves to devDependencies (only scripts/prepare-data.ts imports
it, at build time); @types/proj4 goes (a deprecated stub - proj4 ships
its own types); n8ao/postprocessing/three-mesh-bvh get the exact pins
AGENTS.md already claimed for the three.js stack.
- Delete types/three-mesh-bvh.d.ts: the package declares the same
`module 'three'` augmentation itself, and more completely (it covers
BatchedMesh too). skipLibCheck was hiding the disagreement.
- tsconfig target ES2017 -> ES2022. allowJs stays: `next build` rewrites
the file to put it back, so removing it dirties the tree every build.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
actions/checkout v6 -> v7. The headline change is that v7 refuses to check out fork PR code under `pull_request_target` / `workflow_run` by default (the "pwn request" class). That is a no-op for us and safe to take: ci.yml only runs on `pull_request` / `push`, and pr-title.yml - the one `pull_request_target` workflow - never checks out at all. What we get is the ESM migration and the dependency security fixes. actions/cache v5 -> v6. ESM plus updated toolkit; v6.1.0 carries actions/toolkit#2435, which handles a cache write failing on a read-only token instead of warning. That is exactly the e2e job's case on fork PRs, where both the .next/cache and Playwright-browser saves run with a read-only token. upload-artifact (v7), setup-bun (v2) and action-semantic-pull-request (v6) are already on their latest majors. Dependabot's npm budget goes 5 -> 10. Superseded PRs hold a slot until someone closes them, so at 5 a single stale major starves every other group - which is how Biome, ultracite, ESLint and @types/node sat still since June. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
.mcp.json ran `npx -y next-devtools-mcp@latest` on every session: an unpinned package fetched outside the lockfile, invisible to Dependabot and `bun audit`, and against the pinning convention the neighbouring shadcn entry already follows. Pinned to 0.4.0 (current). .claude/settings.json is committed, so its allowlist applies to every agent in the repo. Dropped `Bash(node -e ' *)` and `Bash(python3 -)`, which pre-approve running arbitrary code, and five `Bash(node shoot.mjs ...)` grants for a file that no longer exists. Replaced two single-use literals with the patterns they were reaching for (`extract-*.sh`, `ogrinfo`). 22 entries -> 15. Anyone who wants the interpreter grants back can put them in the untracked settings.local.json. skills-lock.json locked `next-best-practices` and `next-cache-components` from vercel-labs/next-skills; neither is installed under .agents/skills/. Lock and tree now agree at 13 each. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
Each deferral gets its blocker so the next run does not re-derive it: ultracite 7.12 (451 violations across ~10 newly enabled rule families - Biome 2.5.14 alone is clean, so it is a style decision), ESLint 10 (three eslint-config-next plugins still cap their peer at ^9; typescript-eslint 8.70 does now accept ^10), TypeScript 7 (typescript-eslint peers `<6.1.0`), n8ao 2 (no types, and it changes SSAO output, which AGENTS.md says needs the --headed harness on a real GPU), and bun 1.4.2 (needs a machine on that version to regenerate the lockfile). postprocessing 7 is alpha/beta only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
`packageManager` drove both halves: CI reads it through setup-bun's `bun-version-file`, and it is the runtime every script here runs on (`bun test`, `scripts/prepare-data.ts`), so one pin covers build and run. It also closes the skew with `@types/bun`, which has been on ^1.4.2 while the runtime sat at 1.3.11. Validated on a real 1.4.2 install rather than assumed - that was the only reason plan 013 held this back. `bun install --frozen-lockfile` is clean and `bun.lock` does not change at all under 1.4.2, so CI's frozen install keeps working and there is no lockfile-format churn to review. `verify` (lint + typecheck + 149 unit tests) and `next build` both pass on it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
TypeScript 7.0.2 is the native compiler. `bun typecheck` drops 7.8s -> 1.6s and `next build`'s type pass 8.4s -> 2.4s, and both now run the same TS 7, so there is still exactly one type-checking authority. The catch is what the TS 7 npm package *is*: per-platform native binaries plus a `tsc` launcher. It ships no `lib/typescript.js`, so the classic JS compiler API is gone. typescript-eslint consumes that API and does not merely warn - it crashes before ESLint can even load its config (`Cannot read properties of undefined (reading 'Cjs')`), and no typescript-eslint channel, canary included, accepts `typescript >=7`. So ESLint goes and oxlint takes over. oxlint carries its own Rust parser and no TypeScript dependency at all, so it cannot hit that wall. Coverage was checked rule by rule, not assumed. Of the 86 rules `eslint-config-next` had enabled here, oxlint covers 61 - including all 21 Next.js rules, jsx-a11y, and the React-Compiler-era react rules that matter with `reactCompiler: true`. Biome (already in the gate via ultracite) covers the remainder, verified by probing real violations: rules-of-hooks -> useHookAtTopLevel, exhaustive-deps -> useExhaustiveDependencies, plus noTsIgnore, noVar, useConst, noExplicitAny, noNamespace, noBannedTypes, noArguments, noUnusedVariables. Four low-severity rules land nowhere and are called out in AGENTS.md: react/display-name, react/no-unescaped-entities, import/no-anonymous-default-export and @next/next/no-location-assign-relative-destination. The last has no current exposure - nothing in the repo calls `location.assign`. oxfmt is deliberately NOT added: biome already formats this repo, and a second formatter would both fight it and reflow every file. Details: - `.oxlintrc.json` mirrors the old `globalIgnores` and turns off `oxc/erasing-op` for terrain-geometry.ts, where `0 * n` is deliberate row-index arithmetic kept symmetric with the `(n - 1) * n` line. - `bun lint` is `oxlint --max-warnings=0 && ultracite check`; the gate still fails on the first warning. - `.vscode/settings.json` drops `js/ts.tsdk.path`: TS 7 ships no `tsserver` at that path, so pointing the editor there only errors. - Dependabot's `next` and `lint-and-format` groups lose `eslint*` and gain `oxlint`. Dropping ESLint takes the install from 703 packages to 502. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
The oxlint coverage audit in the previous commit was measured against `oxlint --print-config`, which lists only the rules currently ENABLED -- and oxlint's default is the `correctness` category alone. The full catalogue is 653 rules (`--print-config -D all`). Four of the five rules that audit reported as lost do exist: `react/rules-of-hooks`, `react/display-name`, `react/no-unescaped-entities` and `react/jsx-no-comment-textnodes`, plus `import/no-anonymous-default-export`. They were simply not on. Each is now named explicitly in `.oxlintrc.json`, and `rules-of-hooks` and `no-unescaped-entities` were re-probed against a deliberate violation to confirm they fire from the config alone, with no CLI flags. `rules-of-hooks` is the one that mattered: biome's `useHookAtTopLevel` was covering it, so the gate never had a hole, but relying on that was an accident rather than a decision. That leaves exactly one rule from the old ESLint set with no home: `@next/next/no-location-assign-relative-destination`. Nothing in the repo calls `location.assign`. `bun run verify` and `oxlint --max-warnings=0` stay green on the real codebase with all five enabled -- they found nothing to report. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executes
plans/013, re-researched against the registry on 2026-09-21 — several of its conclusions had moved, and three things it listed as blocked turned out not to be.suncalc 1.9 → 2.0.2
2.0 is ESM with named exports, reports degrees instead of radians, and measures azimuth north-based clockwise where 1.x measured it from south toward west. A mechanical import fix would have compiled and shipped the sun rotated 180°, so
lib/city/sun.tsflips both horizontal signs:Verified two ways rather than trusting the unit tests alone:
1.0e-15. The rewrite is the same vector.@types/suncalcis dropped (suncalc ships its own). The pin stays exact: a silent float here rotates the sun rather than failing.TypeScript 7 — and why ESLint had to go
TypeScript 7.0.2, the native compiler.
bun typecheck7.8s → 1.6s,next build's type pass 8.4s → 2.4s, and both run the same TS 7, so there is still exactly one type-checking authority.The catch is what the TS 7 npm package is: per-platform native binaries plus a
tsclauncher. It ships nolib/typescript.js— the classic JS compiler API is gone. typescript-eslint consumes that API and does not merely warn, it crashes before ESLint can load its config (Cannot read properties of undefined (reading 'Cjs')). No typescript-eslint channel, canary included, acceptstypescript >=7.So oxlint replaces ESLint. It carries its own Rust parser and no TypeScript dependency, so it cannot hit that wall.
Coverage: all but one of the 86 rules
Checked rule by rule against the 86 rules
eslint-config-nexthad enabled here. Exactly one has no equivalent anywhere:@next/next/no-location-assign-relative-destination— and nothing in the repo callslocation.assign.Everything else is covered, by oxlint (all 21 Next.js rules, jsx-a11y, the React-Compiler-era react rules that matter under
reactCompiler: true) or by biome, verified by probing real violations rather than matching names:useHookAtTopLevel,useExhaustiveDependencies,noTsIgnore,noVar,useConst,noExplicitAny,noNamespace,noBannedTypes,noArguments,noUnusedVariables.@typescript/typescript6(the shim providing the old JS API) was also built and does work — but it delivers TS 7 only as an extra CLI beside TS 6, with three typescript packages in the tree. oxlint was the preferred route.oxfmt is not part of this PR, but not because it would cause churn — measured, it would reformat zero of the 140 source/config files (both it and biome are Prettier-compatible), touching only
package.jsonkey order and six markdown files. It is deferred because this PR already swaps the type checker, the linter and the runtime, and because dropping biome would give up CSS linting (app/globals.css), which oxlint does not do at all. That is its own decision, for its own PR.Dropping ESLint takes the install from 703 packages to 502, and
bun run verifyfrom ~10s to 2.2s.bun 1.4.2
packageManager: bun@1.4.2covers build and run: all four CI jobs read it viasetup-bun'sbun-version-file, and Vercel reads the same field. It also closes the standing skew with@types/bun(already on ^1.4.2).Validated on a real 1.4.2 install rather than assumed — that was the only reason plan 013 held it back.
bun.lockdoes not change at all under 1.4.2, so--frozen-lockfilekeeps working with no lockfile-format churn to review.Other dependency work
--max-warnings=0gates lint (now on oxlint).geotiff→devDependencies(build-only importer);@types/proj4removed (deprecated stub).n8ao/postprocessing/three-mesh-bvhpinned exactly, as AGENTS.md already claimed.types/three-mesh-bvh.d.tsdeleted — the package declares the samemodule 'three'augmentation itself and more completely (it coversBatchedMesh).targetES2017 → ES2022.allowJsdeliberately kept:next buildrewrites the file to put it back, so removing it (as plan 013 proposed) dirties the tree on every build..vscode/settings.jsondropsjs/ts.tsdk.path— TS 7 ships notsserverat that path.CI actions
actions/checkoutv6 → v7. v7 refuses to check out fork PR code underpull_request_target/workflow_run. Confirmed a no-op here —ci.ymlruns onpull_request/push, andpr-title.yml(the onlypull_request_targetworkflow) never checks out.actions/cachev5 → v6. v6.1.0 carries Backport: Handle cache write error due to RO token actions/toolkit#2435, handling a cache write failing on a read-only token — exactly the e2e job's case on fork PRs.next/lint-and-formatgroups loseeslint*, gainoxlint.Still held back (blockers recorded in
plans/README.md)--headedsnapshot harness on a real GPU.Verification
bun run verify— green (2.2s)bun install --frozen-lockfileunder bun 1.4.2 — green, lockfile unchangedbun run build— green, idempotent w.r.t.tsconfig.jsonbun test lib/city/sun.test.ts— 6/6, plus the 360-instant equivalence checkbun run test:e2elocally — 9/9 (3.3 min) on the final TS 7 + oxlint config, includingrenders buildings, terrain and shadows, which drives the sun rig through the real scenec01a746— Lint, Typecheck, Unit, E2E, Conventional Commits and the Vercel preview deploy🤖 Generated with Claude Code
https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8