Closed
Description
TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
For a JavaScript project
jsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"allowSyntheticDefaultImports": false
}
}
a.js
var foo = 'test'
b.js
var foo = 2
Expected behavior:
There should be a way to configure TypeScript to treat a.js
and b.js
as isolated units. That way, foo
would have the type as defined in its file
Actual behavior:
The files are treated as a single unit. foo
either has a string
or number
type in both files.