Skip to content

fix: update TypeScript init scaffold for ESM tooling#81

Open
beeman wants to merge 1 commit intoblueshift-gg:masterfrom
beeman:beeman/init-template-fixes
Open

fix: update TypeScript init scaffold for ESM tooling#81
beeman wants to merge 1 commit intoblueshift-gg:masterfrom
beeman:beeman/init-template-fixes

Conversation

@beeman
Copy link
Contributor

@beeman beeman commented Mar 24, 2026

Generate ESM package metadata and a typecheck script for TypeScript test projects.

Also switch the generated tsconfig to bundler-style module resolution and refresh the Node and Vitest dev dependency versions.

Generate ESM package metadata and a typecheck script for TypeScript test projects.

Also switch the generated tsconfig to bundler-style module resolution and refresh the Node and Vitest dev dependency versions.
Comment on lines +80 to +85
"module": "preserve",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "ESNext",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are modern settings that fix the error in the screenshot, and make TypeScript convenient to work with (no need to use .js/.ts for imports, for example).

Image

}},
"devDependencies": {{
"@types/node": "^22.0.0",
"@types/node": "^22.13.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This version of Node stabilized the WebCrypto api.

"@types/node": "^22.13.0",
"typescript": "^5.9.3",
"vitest": "^3.1.0"
"vitest": "^4.1.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's use the latest version

"private": true,
"type": "module",
"scripts": {{
"check-types": "tsc --noEmit",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having quick access to a type check is useful, it helps find issues like the one fixed in #82

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.

1 participant