Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes#1744
Upgrade TypeScript 5.9.3 → 6.0.2 with TS6 breaking change fixes#1744
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure 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
Scanned Files
|
📸 Automated UI Screenshots📋 Screenshots Captured (8)
📦 Download Screenshots📥 Download all screenshots from workflow artifacts
🤖 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>
🎯 Accessibility Test ResultsWCAG 2.1 Level AA Compliance Tests
Components Tested
Test Framework
|
📸 Automated UI Screenshots📋 Screenshots Captured (8)
📦 Download Screenshots📥 Download all screenshots from workflow artifacts
🤖 Generated by Playwright automation |
There was a problem hiding this comment.
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.TimeoutwithReturnType<typeof setTimeout>in source, and replaceglobalusage withglobalThisin 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
countdownTimeris assigned fromsetTimeout(...), butclearTimerscallsclearInterval(countdownTimer.current). While many runtimes accept either clear function, this is semantically incorrect and makes the code harder to reason about. UseclearTimeoutforcountdownTimer(and consider renaming it tocountdownTimeoutto 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;
src/hooks/useCombatTimer.ts
Outdated
| 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); |
There was a problem hiding this comment.
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.
| const intervalRef = useRef<ReturnType<typeof setTimeout> | null>(null); | |
| const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null); |
src/hooks/useTechniqueSelection.ts
Outdated
|
|
||
| // Ref for cleanup | ||
| const cooldownUpdateIntervalRef = useRef<NodeJS.Timeout | null>(null); | ||
| const cooldownUpdateIntervalRef = useRef<ReturnType<typeof setTimeout> | null>(null); |
There was a problem hiding this comment.
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.
| const cooldownUpdateIntervalRef = useRef<ReturnType<typeof setTimeout> | null>(null); | |
| const cooldownUpdateIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null); |
|
@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>
Fixed in 0dad979 — |
🎯 Accessibility Test ResultsWCAG 2.1 Level AA Compliance Tests
Components Tested
Test Framework
|
📸 Automated UI Screenshots📋 Screenshots Captured (8)
📦 Download Screenshots📥 Download all screenshots from workflow artifacts
🤖 Generated by Playwright automation |
There was a problem hiding this comment.
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
countdownTimeris typed as asetTimeouthandle (and is assigned viasetTimeoutlater), butclearTimersclears it withclearInterval. While this may work in some runtimes, it’s semantically incorrect and becomes confusing now that the ref is explicitly typed. UseclearTimeout(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;
NodeJS.Timeout→ReturnType<typeof setTimeout>(13 source files)global.→globalThis.in test files (12 test files)(global as any)→(globalThis as any)in test filesignoreDeprecations: "6.0"to tsconfig.json (baseUrl deprecation)ignoreDeprecations: "6.0"to cypress/tsconfig.json (moduleResolution: "node" deprecation)ReturnType<typeof setInterval>for interval handles (useCombatTimer, useTechniqueSelection)npm run check(tsc -b passes)npm run lint(0 errors, 1 pre-existing warning)npm run build(builds successfully)npm test(449/450 pass, 1 pre-existing flaky test)