When using TypeScript 2, I get an inconsistent behavior for importing type definitions from @types when using tsc with an explicit tsconfig.json path versus not specifying one.
I have the following setup:
package.json
{
"name": "typings-test",
"devDependencies": {
"@types/es6-shim": "*",
"typescript": "^2.0.0"
}
}
tsconfig.json
test.ts
let x = new Set<string>();
After installing all dependencies with npm install, I call tsc once without arguments and once with -p .:
$ typings-test> tsc
$ typings-test> tsc -p .
test.ts(1,13): error TS2304: Cannot find name 'Set'.
As you can see, the latter fails because it cannot find a definition for Set. So the types that are located in node_modules/@types/es6-shim/index.d.ts are not loaded in this case.
When using TypeScript 2, I get an inconsistent behavior for importing type definitions from
@typeswhen usingtscwith an explicittsconfig.jsonpath versus not specifying one.I have the following setup:
After installing all dependencies with
npm install, I calltsconce without arguments and once with-p .:As you can see, the latter fails because it cannot find a definition for
Set. So the types that are located innode_modules/@types/es6-shim/index.d.tsare not loaded in this case.