Steps to reproduce
- Start a plain new project
- "@typescript/native-preview": "7.0.0-dev.20260428.1",
- "typescript": "6.0.3"
- Run
npx tsgo --init to get the default tsconfig. Turn on these flags as well.
- "allowJs": true,
- "checkJs": true,
- "stableTypeOrdering": true,
- Add
src/main.js. Run npx tsc --noEmit & npx tsgo --noEmit to see the difference.
// src/main.js
new Promise((resolve) => resolve());
Behavior with typescript@6.0
src/main.js:2:26 - error TS2810: Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.
2 new Promise((resolve) => resolve());
~~~~~~~
Found 1 error in src/main.js:2
Behavior with tsgo
src/main.js:2:26 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
2 new Promise((resolve) => resolve());
~~~~~~~
node_modules/.../lib.es2015.promise.d.ts:29:34 - An argument for 'value' was not provided.
29 new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in src/main.js:2
I think TS 6 makes more sense in this case, since type argument is not really a thing inside a javascript file.
Steps to reproduce
npx tsgo --initto get the default tsconfig. Turn on these flags as well.src/main.js. Runnpx tsc --noEmit&npx tsgo --noEmitto see the difference.Behavior with
typescript@6.0Behavior with
tsgoI think TS 6 makes more sense in this case, since
type argumentis not really a thing inside a javascript file.