Skip to content

Add node and jest to types in tsconfig - #462

Merged
atm-snag2 merged 1 commit into
mainfrom
add-node-jest-types-to-tsconfig
Oct 26, 2026
Merged

atm-snag2 merged 1 commit into
mainfrom
add-node-jest-types-to-tsconfig

Conversation

@atm-snag2

Copy link
Copy Markdown
Contributor

What

Explicitly list node and jest in compilerOptions.types of the root tsconfig.json.

How

  • src/client/tsconfig.json extends the root config, so this setting also applies to the client type check.
  • With TypeScript 5.9 this is a no-op for the current code: these two are the only @types/* packages whose globals are used without an import. Other @types/* packages (react, express, ws, etc.) are still resolved through imports.

Why

TypeScript 6.0 changes the default of types to [], so @types/* packages are no longer included automatically. On the TypeScript 6.0.3 bump (#459), globals such as describe, expect, jest, global and require become unresolved and the type check and build fail. Merging this first lets #459 pass as is.

Refs

TypeScript 6.0 changes the default of `types` to `[]`, so `@types/*`
packages are no longer included automatically and globals such as
`describe`, `expect`, `jest`, `global` and `require` become unresolved.
List them explicitly so the build keeps working after the upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atm-snag2 atm-snag2 self-assigned this Oct 23, 2026
@atm-snag2

Copy link
Copy Markdown
Contributor Author

Verification

Ran on this branch (TypeScript 5.9.3, Node.js 24.22.1, pnpm 10.34.7). All commands exited with 0.

Command Result
pnpm run lint:typecheck No errors (root and src/client)
pnpm run build tsc --build succeeded, webpack 5.111.1 compiled successfully
pnpm run test Test Suites: 26 passed, 26 total / Tests: 248 passed, 248 total
pnpm run lint:eslint No errors

On the head of #459 (TypeScript 6.0.3), tsc --noEmit reports 1,200 errors at the root and 19 errors with -p src/client. Adding --types node,jest (equivalent to this change) brings both to 0.

@atm-snag2
atm-snag2 marked this pull request as ready for review October 23, 2026 03:43
@atm-snag2
atm-snag2 requested review from a team and kimkim0814 and removed request for a team October 23, 2026 03:46

@kimkim0814 kimkim0814 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@atm-snag2
atm-snag2 merged commit 542e9aa into main Oct 26, 2026
11 checks passed
@atm-snag2
atm-snag2 deleted the add-node-jest-types-to-tsconfig branch October 26, 2026 00:17
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.

2 participants