Repository navigation
Upgrade to TypeScript 7 and tighten type checking - #316
Merged
Merged
Conversation
- typescript ^6.0.3 -> ^7.0.2; no code changes needed, generated .d.ts unchanged - Remove typedoc and the docs script: TypeDoc 0.28 needs the JS compiler API, which TypeScript 7 does not have - Note docs generation in knowledge/backlog.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tsconfig: enable noImplicitAny (via strict), declaration + isolatedDeclarations, add DOM to lib; drop unused allowJs and redundant noImplicitThis - util: type the OSM graph/entity params (OsmGraphLike, OsmEntityLike) instead of any; utilStringQs returns Record<string, string>; utilQsString takes a Record; GroupBy/UniqBy key functions may return numbers - util: utilSessionMutex returns a SessionMutex and no longer writes a mock document onto globalThis; add @types/aes-js and @types/diacritics - math: Tiler accessors use getter/setter overloads, so tileSize(512) returns this and tileSize() returns number; annotate computed constants - tests: replace as any with @ts-expect-error for intentionally invalid input Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Math stays off: its indexing is mostly bounds-safe hot loops, and the flag would add ~200 non-null assertions or guards. Recorded why in decisions.md, and expanded the benchmarks backlog item into a performance pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Upgrades to TypeScript 7 (the native compiler), following the agent-practices TypeScript 7 playbook, then tightens the compiler settings while we're here.
Upgrade to TypeScript 7
typescriptgoes to^7.0.2.docsscript are removed. TypeDoc 0.28 needs TypeScript's JavaScript compiler API, which TypeScript 7 doesn't have. The backlog has a note on docs generation, including a one-off command that regenerates them with TypeScript 6.Tighten TypeScript settings and remove
anynoImplicitAnyandisolatedDeclarations, and dropsallowJs.OsmEntityLike,OsmGraphLikeandSessionMutextypes, so the osm helpers andutilSessionMutexno longer take or returnany.Tiler's getter/setter methods (tileSize,zoomRange,margin,skipNullIsland) use overloads, sot.tileSize()returns anumberandt.tileSize(512)returns theTiler.utilSessionMutexno longer assigns a mockdocumenttoglobalThisoutside the browser.as anycasts with@ts-expect-errorand type their fixtures.The generated
.d.tsfiles change only where the API typings above were tightened. A simulated TypeScript 7 consumer type-checks under bothnodenextandbundlerresolution.Enable
noUncheckedIndexedAccessfor utilpackages/util/tsconfig.jsononly. Turning it on needed 14 small fixes in source and none in tests.!marks or runtime guards.knowledge/decisions.mdrecords why. The benchmarks item in the backlog is now a performance pass, which may make the flag cheap to turn on for math later.bun run allpasses: 522 tests.🤖 Generated with Claude Code