TypeScript Version: 2.3.1-0414insiders
Code
In the JS file
/// @ts-check
var x = "string";
x = 0;
With a jsconfig.json:
{
"compilerOptions": {
},
"exclude": [
"node_modules"
],
"include": [
"*.js"
]
}
Expected behavior:
In my understanding, the /// @ts-check directive should enable checks in the js file, even though checkJs is not set in the config
Actual behavior:
This directive does not seem have any effect. Enabling checkJs enables the js error reporting. When using a tsconfig with "allowJs": true, I do see error reporting even when checkJs has not been set
Also, I'm unable to use /// @ts-check in javascript file that is part of an an inferred project in VSCode. Here are the options we send:
[Trace - 2:36:21 PM] Sending request: compilerOptionsForInferredProjects (1). Response expected: yes. Current queue length: 2
Arguments: {
"options": {
"module": "CommonJS",
"target": "ES6",
"allowSyntheticDefaultImports": true,
"allowNonTsExtensions": true,
"allowJs": true,
"jsx": "Preserve"
}
}
TypeScript Version: 2.3.1-0414insiders
Code
In the JS file
With a
jsconfig.json:{ "compilerOptions": { }, "exclude": [ "node_modules" ], "include": [ "*.js" ] }Expected behavior:
In my understanding, the
/// @ts-checkdirective should enable checks in the js file, even thoughcheckJsis not set in the configActual behavior:
This directive does not seem have any effect. Enabling
checkJsenables the js error reporting. When using atsconfigwith"allowJs": true, I do see error reporting even whencheckJshas not been setAlso, I'm unable to use
/// @ts-checkin javascript file that is part of an an inferred project in VSCode. Here are the options we send: