π Search Terms
ts-check
π Version & Regression Information
- This changed between versions 4.4.4 and 4.5.2
β― Playground Link
Meaningless to paste playground link I guess, when it is about typechecking plain javascript file
π» Code
src/main.js
// @ts-check
export const x = parseFloat(3.14);
src/main.d.ts
π Actual behavior
No error.
π Expected behavior
src/main.js:3:29 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
3 export const x = parseFloat(3.14);
~~~~
Found 1 error.
Additional information about the issue
Note that the error will reappear when "include" is reorder as ["src/*.d.ts", "src/*.js"].
Also note that https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html mentioned no such behaviour change regarding @ts-check.
π Search Terms
ts-check
π Version & Regression Information
β― Playground Link
Meaningless to paste playground link I guess, when it is about typechecking plain javascript file
π» Code
src/main.jssrc/main.d.ts{ "compilerOptions": { "rootDir": ".", "outDir": "./dist", "target": "esnext", "types": [], "sourceMap": true, "strict": true, "isolatedModules": true, "skipLibCheck": true, "allowJs": true, }, "include": [ "src/*.js", "src/*.d.ts", ] }π Actual behavior
No error.
π Expected behavior
Additional information about the issue
Note that the error will reappear when
"include"is reorder as["src/*.d.ts", "src/*.js"].Also note that https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html mentioned no such behaviour change regarding
@ts-check.