Conversation
- 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>
- 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>
|
Test and Report / e2e-tests (pull_request) |
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>
|
Fixed in f80129b. The Cypress e2e tests failed because TypeScript 6.0 deprecates |
There was a problem hiding this comment.
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”. |
| "src/test/**/*", | ||
| "src/**/*.ts", | ||
| "src/**/*.tsx" |
There was a problem hiding this comment.
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.
| "src/test/**/*", | |
| "src/**/*.ts", | |
| "src/**/*.tsx" | |
| "src/test/**/*" |
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
global→globalThis— TS6 removes implicitglobalnamespace in bundler modeNodeJS.Timeout→ReturnType<typeof setTimeout>— portable timer type, no Node namespace dependencyimport * as fs from "fs"→import { readFileSync } from "node:fs"— TS6 bundler moduleResolution no longer resolves bare Node built-in specifiers; also replaces__dirnamewithimport.meta.urlignoreDeprecations: "6.0"— TS6 deprecatesmoduleResolution: "node10"anddownlevelIteration, which Cypress's internal webpack preprocessor (ts-loader) requires; added"ignoreDeprecations": "6.0"tocypress/tsconfig.jsontsconfig 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": []+referencestsconfig.app.json→composite: true, excludes**/*.test.{ts,tsx}andsrc/test/tsconfig.test.json(new) → includes"types": ["vitest/globals", "node"]for test fileseslint.config.js→ addedtsconfig.test.jsonto parser project listDocumentation Updates
@typescript-eslintconstraint (<6.1.0)