chore: upgrade TypeScript to 5.9.3 and enable .ts imports#3043
Open
bennypowers wants to merge 5 commits intomasterfrom
Open
chore: upgrade TypeScript to 5.9.3 and enable .ts imports#3043bennypowers wants to merge 5 commits intomasterfrom
bennypowers wants to merge 5 commits intomasterfrom
Conversation
- Upgrade TypeScript from 5.0.4 to 5.9.3 - Update eslint, prettier, and related dev dependencies - Enable `module: nodenext` and `rewriteRelativeImportExtensions` in tsconfigs - Rewrite all relative imports from .js to .ts extensions - Add `type` keyword to type-only imports across source files - Remove TypeScript parameter properties from constructors (DevServer, PluginSyntaxError, WebSocketsManager) - Fix internal-ip CJS interop for nodenext module resolution - Add @ts-ignore for deprecated puppeteer accessibility API Zero runtime behavior change — output remains CJS. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This was referenced Mar 16, 2026
prettier-plugin-package v1.x requires prettier ^2, which conflicts with our upgrade to prettier ^3.7.1. v2.0.0 supports prettier ^3. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@typescript-eslint v8 enables stricter rules by default. Disable rules that flag pre-existing code patterns: - no-require-imports: CJS require() in .js files - no-unused-expressions: chai expect() assertions in tests - no-empty-object-type: {} type usage - no-unsafe-function-type: Function type usage - no-unused-vars: allow unused catch parameters Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TS 5.9 with module:nodenext requires explicit return type annotation when the inferred type references a non-portable path (TS2742). Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Extensions TypeScript's rewriteRelativeImportExtensions injects a __rewriteRelativeImportExtension helper into the output. This helper is not needed in browser bundles and breaks test execution. Add stripRewriteImportExtensionPlugin to remove the helper from the rollup output. Also add resolveMochaPlugin for robust monorepo module resolution. Assisted-By: Claude Opus 4.6 (1M context) <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.
Summary
~5.0.4to^5.9.3module: nodenextandrewriteRelativeImportExtensionsin tsconfigs.jsto.tsextensions (~200 source files)typekeyword to type-only imports^8.57.1), prettier (^3.7.1), and @typescript-eslint (^8.48.0)Zero runtime behavior change — output remains CJS. This is PR 1 of 4 in the Node 24 migration stack.
Stack
.tsimportsnode24/test-migration— mocha/chai → node:test migrationnode24/esm-and-node24— CJS→ESM + Node 24 requirementnode24/parse5-and-jsdoc— parse5 v8 + JSDoc→TS conversionsTest plan
npm run buildpasses with zero TS errors🤖 Generated with Claude Code