Skip to content

Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes#1744

Merged
pethers merged 3 commits intomainfrom
copilot/upgrade-typescript-to-6-0-2
Mar 31, 2026
Merged

Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes#1744
pethers merged 3 commits intomainfrom
copilot/upgrade-typescript-to-6-0-2

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

  • Upgrade TypeScript from 5.9.3 to 6.0.2 in package.json
  • Fix TS6 breaking changes: NodeJS.TimeoutReturnType<typeof setTimeout> (13 source files)
  • Fix TS6 breaking changes: global.globalThis. in test files (12 test files)
  • Fix TS6 breaking changes: (global as any)(globalThis as any) in test files
  • Add ignoreDeprecations: "6.0" to tsconfig.json (baseUrl deprecation)
  • Add ignoreDeprecations: "6.0" to cypress/tsconfig.json (moduleResolution: "node" deprecation)
  • Use ReturnType<typeof setInterval> for interval handles (useCombatTimer, useTechniqueSelection)
  • Update release-drafter.yml: TypeScript 5.9+ → TypeScript 6
  • Update End-of-Life-Strategy.md: TypeScript ^5.9.3 → ^6.0.2, updated Gantt chart and lifecycle table
  • Update WORKFLOWS.md: Added current TypeScript version: 6.0.2
  • Update development.md: TypeScript 5.9.3 → 6.0.2
  • Update README.md: TypeScript 5.9 → 6.0
  • Update FUTURE_MINDMAP.md: TypeScript 5+ → 6+
  • Validated with npm run check (tsc -b passes)
  • Validated with npm run lint (0 errors, 1 pre-existing warning)
  • Validated with npm run build (builds successfully)
  • Validated with npm test (449/450 pass, 1 pre-existing flaky test)
  • Code review passed
  • CodeQL security check (0 alerts)
  • Dependency security check (typescript@6.0.2 - no vulnerabilities)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 0dad979.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/typescript 6.0.2 🟢 8.3
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 1030 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Dependency-Update-Tool🟢 10update tool detected
Security-Policy🟢 10security policy file detected
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Vulnerabilities🟢 73 existing vulnerabilities detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Binary-Artifacts🟢 10no binaries found in the repo
Branch-Protection⚠️ -1internal error: error during GetBranch(release-5.9): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration
Pinned-Dependencies🟢 6dependency not pinned by hash detected -- score normalized to 6
SAST🟢 9SAST tool detected but not run on all commits
Fuzzing🟢 10project is fuzzed
CI-Tests🟢 1030 out of 30 merged PRs checked by a CI test -- score normalized to 10
Contributors🟢 10project has 35 contributing companies or organizations

Scanned Files

  • package-lock.json

@github-actions
Copy link
Copy Markdown
Contributor

📸 Automated UI Screenshots

📋 Screenshots Captured (8)

# Screenshot
1 01-splash-screen.png - 01 splash screen.png
2 02-intro-screen-menu.png - 02 intro screen menu.png
3 03-intro-screen-archetype-selector.png - 03 intro screen archetype selector.png
4 04-controls-screen.png - 04 controls screen.png
5 05-philosophy-screen.png - 05 philosophy screen.png
6 06-training-screen.png - 06 training screen.png
7 07-combat-screen-practice.png - 07 combat screen practice.png
8 08-combat-screen-versus.png - 08 combat screen versus.png

📦 Download Screenshots

📥 Download all screenshots from workflow artifacts

Screenshots are preserved as workflow artifacts for 30 days.


🤖 Generated by Playwright automation

…s and documentation updates

Agent-Logs-Url: https://github.com/Hack23/blacktrigram/sessions/9dbb6f7f-2195-4250-a09f-9ba80187f9bf

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added documentation Documentation updates dependencies Dependency updates infrastructure CI/CD and build infrastructure graphics Graphics and rendering (PixiJS) audio Audio and sound effects ui User interface improvements config Configuration changes testing Testing improvements test-coverage-impact Impacts test coverage needs-tests Needs test coverage e2e End-to-end testing three-components labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎯 Accessibility Test Results

WCAG 2.1 Level AA Compliance Tests

  • ✅ Color contrast validation (4.5:1 for text, 3:1 for UI)
  • ✅ ARIA labels and roles validation
  • ✅ Keyboard navigation structure validation
  • ✅ Focus indicators validation
  • ✅ Dialog and menu semantics validation
  • ✅ Progress bars and timers validation

Components Tested

  • Accessibility utilities (keyboard nav, focus management)
  • Bilingual ARIA labels (Korean-English)
  • Button groups (VirtualDPad pattern)
  • Radiogroups (StanceWheel pattern)
  • Dialogs (PauseMenu pattern)
  • Progress bars (HealthBar, StaminaBar pattern)
  • Timers (CombatTimer pattern)

Test Framework

  • Tool: axe-core via jest-axe
  • Standard: WCAG 2.1 Level AA
  • Test Runner: Vitest

Copilot AI changed the title [WIP] Upgrade to Typescript 6.0.2 and update relevant documents Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes Mar 31, 2026
Copilot AI requested a review from pethers March 31, 2026 12:39
@pethers pethers marked this pull request as ready for review March 31, 2026 12:46
@pethers pethers requested a review from Copilot March 31, 2026 12:46
@github-actions
Copy link
Copy Markdown
Contributor

📸 Automated UI Screenshots

📋 Screenshots Captured (8)

# Screenshot
1 01-splash-screen.png - 01 splash screen.png
2 02-intro-screen-menu.png - 02 intro screen menu.png
3 03-intro-screen-archetype-selector.png - 03 intro screen archetype selector.png
4 04-controls-screen.png - 04 controls screen.png
5 05-philosophy-screen.png - 05 philosophy screen.png
6 06-training-screen.png - 06 training screen.png
7 07-combat-screen-practice.png - 07 combat screen practice.png
8 08-combat-screen-versus.png - 08 combat screen versus.png

📦 Download Screenshots

📥 Download all screenshots from workflow artifacts

Screenshots are preserved as workflow artifacts for 30 days.


🤖 Generated by Playwright automation

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 repo to TypeScript 6.0.2 and applies targeted compatibility fixes for TS6 “bundler” typing changes, while updating various docs to reflect the new TS baseline.

Changes:

  • Bump TypeScript to 6.0.2 and add ignoreDeprecations: "6.0" to relevant tsconfigs.
  • Replace NodeJS.Timeout with ReturnType<typeof setTimeout> in source, and replace global usage with globalThis in tests to avoid implicit Node globals under TS6/bundler typing.
  • Update documentation files to reference TypeScript 6.x.

Reviewed changes

Copilot reviewed 33 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WORKFLOWS.md Documents the current TypeScript version used by CI/dev workflows.
tsconfig.json Adds ignoreDeprecations: "6.0" to suppress TS6 deprecation noise (e.g. baseUrl).
cypress/tsconfig.json Adds ignoreDeprecations: "6.0" for Cypress TS config compatibility.
package.json Upgrades typescript from 5.9.3 to 6.0.2.
package-lock.json Updates lockfile for TypeScript 6.0.2 and related dependency tree changes.
src/utils/deviceDetection.test.ts Switches test mocks from global to globalThis for TS6/bundler typing.
src/utils/controlMapping.test.ts Switches localStorage mocking to globalThis.
src/hooks/useWindowSize.test.ts Switches SSR/window simulation from global to globalThis.
src/hooks/useKeyboardControls.test.ts Switches localStorage mocking to globalThis.
src/components/shared/three/indicators/HapticFeedback.test.ts Switches navigator/window mocking from global to globalThis.
src/components/shared/mobile/PerformanceMonitor.test.ts Switches navigator mocking from global to globalThis.
src/components/shared/mobile/HapticController.test.ts Switches navigator mocking from global to globalThis.
src/audio/AudioUtils.test.ts Switches Audio mocking/deletes from global to globalThis.
src/audio/AudioPool.test.ts Switches Audio constructor references from global to globalThis.
src/audio/AudioManager.test.ts Switches Audio/AudioContext mocking from global to globalThis.
src/audio/AudioCache.integration.test.ts Switches Audio/AudioContext mocking from global to globalThis.
src/audio/AudioAssetLoader.test.ts Switches Audio mocking from global to globalThis.
src/hooks/useDebounce.ts Replaces NodeJS.Timeout with ReturnType<typeof setTimeout> for portability.
src/hooks/useThrottle.ts Replaces NodeJS.Timeout with ReturnType<typeof setTimeout> for portability.
src/hooks/useTechniqueSelection.ts Replaces NodeJS.Timeout with portable timer handle typing (but see review comment re: interval typing).
src/hooks/useRoundTransition.ts Replaces NodeJS.Timeout with portable timer handle typing (but see review comment re: clear function semantics).
src/hooks/useCombatTimer.ts Replaces NodeJS.Timeout with portable timer handle typing (but see review comment re: interval typing).
src/audio/AudioAssetLoader.ts Replaces NodeJS.Timeout with ReturnType<typeof setTimeout> for load timeout tracking.
src/components/shared/mobile/TouchOptimizer.test.ts Updates mocked timer return type to avoid NodeJS.Timeout usage.
src/components/screens/training/TrainingScreen3D.tsx Updates timer ref typing to portable timer handle.
src/components/screens/training/hooks/useTrainingActions.ts Updates timer ref typing to portable timer handle.
src/components/screens/training/components/HitFeedbackEffect3D.tsx Updates timer ref typing to portable timer handle.
src/components/screens/combat/hooks/useGrapplingAudio.ts Updates Set of timer handles to portable timer handle type.
src/components/screens/combat/hooks/useCombatAudio.ts Updates Set of timer handles to portable timer handle type.
src/components/screens/combat/hooks/useCombatActions.ts Updates knockback timeout refs to portable timer handle type.
README.md Updates the documented stack to TypeScript 6.0.
development.md Updates the documented TypeScript version to 6.0.2.
FUTURE_MINDMAP.md Updates roadmap references from TypeScript 5+ to 6+.
End-of-Life-Strategy.md Updates TypeScript version references and timeline/diagram labels for TS6.
.github/release-drafter.yml Updates release template stack line from “TypeScript 5.9+” to “TypeScript 6”.
Comments suppressed due to low confidence (1)

src/hooks/useRoundTransition.ts:132

  • countdownTimer is assigned from setTimeout(...), but clearTimers calls clearInterval(countdownTimer.current). While many runtimes accept either clear function, this is semantically incorrect and makes the code harder to reason about. Use clearTimeout for countdownTimer (and consider renaming it to countdownTimeout to match behavior).
  const countdownTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
  const transitionTimer = useRef<ReturnType<typeof setTimeout> | null>(null);

  /**
   * Clear all active timers
   */
  const clearTimers = useCallback(() => {
    if (countdownTimer.current) {
      clearInterval(countdownTimer.current);
      countdownTimer.current = null;

const [isTimeUp, setIsTimeUp] = useState(false);
const lastWarningRef = useRef<TimerWarningLevel>("none");
const intervalRef = useRef<NodeJS.Timeout | null>(null);
const intervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);
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.

intervalRef is used for a setInterval(...) handle (and is passed to clearInterval), but its type is ReturnType<typeof setTimeout>. This is misleading and can become a type-compatibility issue depending on ambient timer typings. Use ReturnType<typeof setInterval> for interval handles.

Suggested change
const intervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);

Copilot uses AI. Check for mistakes.

// Ref for cleanup
const cooldownUpdateIntervalRef = useRef<NodeJS.Timeout | null>(null);
const cooldownUpdateIntervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);
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.

cooldownUpdateIntervalRef stores the result of setInterval(...) and is cleared via clearInterval, but it is typed as ReturnType<typeof setTimeout>. Type it as ReturnType<typeof setInterval> to match usage and avoid timer-handle type mismatches.

Suggested change
const cooldownUpdateIntervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const cooldownUpdateIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Mar 31, 2026

@copilot apply changes based on the comments in this thread

…tTimer and useTechniqueSelection

Agent-Logs-Url: https://github.com/Hack23/blacktrigram/sessions/86f85c43-fcf7-42bc-8c3b-efdbefcd2dcf

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot apply changes based on the comments in this thread

Fixed in 0dad979intervalRef in useCombatTimer.ts and cooldownUpdateIntervalRef in useTechniqueSelection.ts now use ReturnType<typeof setInterval> to match their setInterval/clearInterval usage.

@github-actions
Copy link
Copy Markdown
Contributor

🎯 Accessibility Test Results

WCAG 2.1 Level AA Compliance Tests

  • ✅ Color contrast validation (4.5:1 for text, 3:1 for UI)
  • ✅ ARIA labels and roles validation
  • ✅ Keyboard navigation structure validation
  • ✅ Focus indicators validation
  • ✅ Dialog and menu semantics validation
  • ✅ Progress bars and timers validation

Components Tested

  • Accessibility utilities (keyboard nav, focus management)
  • Bilingual ARIA labels (Korean-English)
  • Button groups (VirtualDPad pattern)
  • Radiogroups (StanceWheel pattern)
  • Dialogs (PauseMenu pattern)
  • Progress bars (HealthBar, StaminaBar pattern)
  • Timers (CombatTimer pattern)

Test Framework

  • Tool: axe-core via jest-axe
  • Standard: WCAG 2.1 Level AA
  • Test Runner: Vitest

@github-actions
Copy link
Copy Markdown
Contributor

📸 Automated UI Screenshots

📋 Screenshots Captured (8)

# Screenshot
1 01-splash-screen.png - 01 splash screen.png
2 02-intro-screen-menu.png - 02 intro screen menu.png
3 03-intro-screen-archetype-selector.png - 03 intro screen archetype selector.png
4 04-controls-screen.png - 04 controls screen.png
5 05-philosophy-screen.png - 05 philosophy screen.png
6 06-training-screen.png - 06 training screen.png
7 07-combat-screen-practice.png - 07 combat screen practice.png
8 08-combat-screen-versus.png - 08 combat screen versus.png

📦 Download Screenshots

📥 Download all screenshots from workflow artifacts

Screenshots are preserved as workflow artifacts for 30 days.


🤖 Generated by Playwright automation

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

Copilot reviewed 33 out of 35 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/hooks/useRoundTransition.ts:132

  • countdownTimer is typed as a setTimeout handle (and is assigned via setTimeout later), but clearTimers clears it with clearInterval. While this may work in some runtimes, it’s semantically incorrect and becomes confusing now that the ref is explicitly typed. Use clearTimeout(countdownTimer.current) here for clarity and to avoid timer-type mismatches across environments.
  const countdownTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
  const transitionTimer = useRef<ReturnType<typeof setTimeout> | null>(null);

  /**
   * Clear all active timers
   */
  const clearTimers = useCallback(() => {
    if (countdownTimer.current) {
      clearInterval(countdownTimer.current);
      countdownTimer.current = null;

@pethers pethers merged commit 6995d85 into main Mar 31, 2026
19 checks passed
@pethers pethers deleted the copilot/upgrade-typescript-to-6-0-2 branch March 31, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audio Audio and sound effects config Configuration changes dependencies Dependency updates documentation Documentation updates e2e End-to-end testing graphics Graphics and rendering (PixiJS) infrastructure CI/CD and build infrastructure needs-tests Needs test coverage test-coverage-impact Impacts test coverage testing Testing improvements three-components ui User interface improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants