Skip to content

Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes and documentation updates#539

Merged
pethers merged 4 commits intomainfrom
copilot/move-project-to-typescript-6-0-2
Mar 31, 2026
Merged

Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes and documentation updates#539
pethers merged 4 commits intomainfrom
copilot/move-project-to-typescript-6-0-2

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Upgrades TypeScript to 6.0.2 and fixes all TS6 breaking changes. Updates all documentation covering TypeScript versioning, end-of-life strategy, and release drafter.

TS6 Breaking Change Fixes

  • globalglobalThis — TS6 removes implicit global namespace in bundler mode
  • NodeJS.TimeoutReturnType<typeof setTimeout> — portable timer type, no Node namespace dependency
  • import * as fs from "fs"import { readFileSync } from "node:fs" — TS6 bundler moduleResolution no longer resolves bare Node built-in specifiers; also replaces __dirname with import.meta.url
  • Cypress ignoreDeprecations: "6.0" — TS6 deprecates moduleResolution: "node10" and downlevelIteration, which Cypress's internal webpack preprocessor (ts-loader) requires; added "ignoreDeprecations": "6.0" to cypress/tsconfig.json

tsconfig Restructure

TS6 with moduleResolution: "bundler" no longer resolves Node.js built-ins in browser-targeted configs. Fixed by adopting standard Vite project references:

  • tsconfig.json → solution file with "files": [] + references
  • tsconfig.app.jsoncomposite: true, excludes **/*.test.{ts,tsx} and src/test/
  • tsconfig.test.json (new) → includes "types": ["vitest/globals", "node"] for test files
  • eslint.config.js → added tsconfig.test.json to parser project list
// tsconfig.json — now a solution file
{
  "files": [],
  "references": [
    { "path": "./tsconfig.app.json" },
    { "path": "./tsconfig.node.json" }
  ]
}

Documentation Updates

  • End-of-Life-Strategy.md — renamed scope to "Runtime & Toolchain", added TypeScript lifecycle table, release cadence, upgrade policy/triggers, toolchain version matrix, and TS-specific risks
  • WORKFLOWS.md — added TypeScript 6.0.2 to current version header
  • FUTURE_WORKFLOWS.md — added TS 6.1/7.0 upgrade planning section, updated compatibility table with @typescript-eslint constraint (<6.1.0)
  • release-drafter.yml — stack template now says "TypeScript 6"
  • README.md — features list updated to "TypeScript 6"

- Update package.json typescript dependency to 6.0.2
- Fix TS6 compatibility: replace `global` with `globalThis` in tests
- Fix TS6 compatibility: replace `NodeJS.Timeout` with `ReturnType<typeof setTimeout>`
- Fix TS6 compatibility: use `node:` protocol imports in security-headers test
- Restructure tsconfig to use project references (standard Vite approach)
- Add tsconfig.test.json for test file type checking with Node.js types
- Add tsconfig.test.json to ESLint parser project list

Agent-Logs-Url: https://github.com/Hack23/game/sessions/2271a341-c50f-4c5a-9e05-3a1961b6cbda

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added dependencies Dependency updates infrastructure CI/CD and build infrastructure config Configuration changes testing Testing improvements test-coverage-impact Impacts test coverage needs-tests Needs test coverage labels Mar 31, 2026
- Update End-of-Life-Strategy.md with TypeScript lifecycle section
- Add TypeScript release cadence, upgrade policy, and triggers
- Add TypeScript to version matrix and risk assessment
- Update WORKFLOWS.md to mention TypeScript 6.0.2
- Update FUTURE_WORKFLOWS.md with TypeScript upgrade planning
- Update release-drafter.yml template to reference TypeScript 6
- Update README.md features to reference TypeScript 6

Agent-Logs-Url: https://github.com/Hack23/game/sessions/2271a341-c50f-4c5a-9e05-3a1961b6cbda

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added the documentation Documentation updates label Mar 31, 2026
Copilot AI changed the title [WIP] Update project to TypeScript 6.0.2 and fix documentation issues Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes and documentation updates Mar 31, 2026
Copilot AI requested a review from pethers March 31, 2026 11:45
@pethers
Copy link
Copy Markdown
Member

pethers commented Mar 31, 2026

@copilot

Test and Report / e2e-tests (pull_request)
Test and Report / e2e-tests (pull_request)Failing after 1m
Test and Report Latest Node / e2e-tests (pull_request)
Test and Report Latest Node / e2e-tests (pull_request)Failing after 1m

TypeScript 6.0 deprecates `moduleResolution: "node10"` and
`downlevelIteration`. Cypress's internal webpack preprocessor
(ts-loader) requires node10 resolution, so add
`"ignoreDeprecations": "6.0"` to cypress/tsconfig.json to
suppress these errors during Cypress compilation.

Agent-Logs-Url: https://github.com/Hack23/game/sessions/183cd4c5-2a70-4956-9b8f-e88808ed1470

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added the e2e End-to-end testing label Mar 31, 2026
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot

Test and Report / e2e-tests (pull_request)
...

Fixed in f80129b. The Cypress e2e tests failed because TypeScript 6.0 deprecates moduleResolution: "node10" and downlevelIteration, which Cypress's internal webpack preprocessor (ts-loader) requires. Added "ignoreDeprecations": "6.0" to cypress/tsconfig.json to suppress these TS6 deprecation errors during Cypress compilation.

@pethers pethers marked this pull request as ready for review March 31, 2026 12:01
@pethers pethers requested a review from Copilot March 31, 2026 12:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the repository to TypeScript 6.0.2 and adjusts TS configs, tests, linting, and documentation to accommodate TS6/moduleResolution=bundler breaking changes and improved toolchain governance.

Changes:

  • Bump TypeScript to 6.0.2 and update lockfile accordingly.
  • Restructure TypeScript configs to use project references and split app vs. test compilation contexts.
  • Apply TS6 compatibility fixes in tests (Node built-in imports, globalThis, portable timer types) and update docs/release templates.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Pins TypeScript to 6.0.2.
package-lock.json Updates resolved TypeScript package to 6.0.2.
tsconfig.json Converts to solution-style project references for tsc -b.
tsconfig.app.json Enables composite and excludes tests from the app project.
tsconfig.test.json Adds a dedicated test tsconfig (Vitest + Node types).
eslint.config.js Adds tsconfig.test.json to typed linting projects.
src/test/security-headers.test.ts Switches to node: specifiers and ESM-safe path resolution.
src/hooks/useGameState.ts Replaces NodeJS.Timeout with ReturnType<typeof setTimeout>.
src/hooks/useAudioManager.test.ts Replaces global with globalThis for TS6 bundler compatibility.
cypress/tsconfig.json Adds ignoreDeprecations: "6.0" for Cypress/ts-loader compatibility.
README.md Updates stack description to “TypeScript 6”.
docs/WORKFLOWS.md Documents current TypeScript version as 6.0.2.
docs/FUTURE_WORKFLOWS.md Adds TS upgrade planning and notes @typescript-eslint constraint.
docs/End-of-Life-Strategy.md Expands EOL strategy to include TypeScript/toolchain lifecycle.
.github/release-drafter.yml Updates release template stack line to “TypeScript 6”.

Comment on lines +24 to +26
"src/test/**/*",
"src/**/*.ts",
"src/**/*.tsx"
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsconfig.test.json's include list currently pulls in all src/**/*.ts and src/**/*.tsx in addition to test files. This makes the test project overlap the app project and can significantly increase type-aware ESLint/TS program size (slower linting, higher memory), and risks the test-specific types (vitest/node) being applied to non-test files if tooling selects this project. Consider limiting include to only test entrypoints (e.g., src/**/*.test.* and src/test/**/*) and rely on TypeScript to include imported app files as dependencies, or add an exclude for non-test source patterns.

Suggested change
"src/test/**/*",
"src/**/*.ts",
"src/**/*.tsx"
"src/test/**/*"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration changes dependencies Dependency updates documentation Documentation updates e2e End-to-end testing infrastructure CI/CD and build infrastructure needs-tests Needs test coverage test-coverage-impact Impacts test coverage testing Testing improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants