Skip to content

Modernize tsconfig.json for Node.js module resolution#1528

Merged
minggangw merged 1 commit into
RobotWebTools:developfrom
minggangw:fix-1527
Jun 4, 2026
Merged

Modernize tsconfig.json for Node.js module resolution#1528
minggangw merged 1 commit into
RobotWebTools:developfrom
minggangw:fix-1527

Conversation

@minggangw
Copy link
Copy Markdown
Member

@minggangw minggangw commented Jun 4, 2026

  • Switch module and moduleResolution to nodenext to align with modern Node.js library publishing and ES module resolution semantics.
  • Bump target and lib to es2022. The project's existing engines floor (node >= 20.20.2) guarantees full ES2022 runtime support, so targeting es2022 is safe and lets type-checking reflect modern language features instead of nodenext's floating target: esnext.
  • Add "types": ["node"] so raw tsc --noEmit resolves Node globals (Buffer, setTimeout, child_process, events, AbortSignal) without relying on tsd's implicit @types/node injection.
  • Refactor a top-level await in test/types/index.test-d.ts into an async IIFE, since nodenext classifies the file as CommonJS where top-level await is illegal.
  • Remove stale boilerplate section-label comments (Strict Type-Checking Options, Additional Checks) carried over from the original generated tsconfig template.

Fix: #1527

Copilot AI review requested due to automatic review settings June 4, 2026 08:22
Copy link
Copy Markdown

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

This pull request updates the repository’s TypeScript configuration to use modern Node.js-aware module settings (nodenext) and aligns the type test suite with the updated compilation behavior.

Changes:

  • Switched tsconfig.json to "module" / "moduleResolution": "nodenext" and bumped the compilation target/lib to ES2022.
  • Explicitly included Node.js ambient types in tsconfig.json.
  • Adjusted the Rate type test to avoid top-level await and to assert both the promised and awaited createRate() types.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
tsconfig.json Modernizes TS compiler settings for Node.js module resolution and ES2022 baseline.
test/types/index.test-d.ts Updates type assertions around createRate() and avoids top-level await in the type test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 85.523%. remained the same — minggangw:fix-1527 into RobotWebTools:develop

@minggangw minggangw merged commit 19b5a41 into RobotWebTools:develop Jun 4, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump typescript to es2022

3 participants