TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161208)
Steps to reproduce:
@next)mkdir test && cd test
npm install [email protected]
tsconfig.json./node_modules/.bin/tsc --init
"exclude" to tsconfig.json like this:"exclude": ["**/node_modules"]
touch test.ts
./node_modules/.bin/tsc
Expected behavior:
Compile successfully.
Actual behavior:
A lot of errors in node_modules/typescript folder
The same source code compiles fine on TypeScript 2.1.1.
More tests:
If I change "exclude" to ["node_modules"] the compilation passes without errors. But if I place "node_modules" in a sub-folder it is not excluded neither by ["node_modules"] nor by ["**/node_modules"] and it leads to errors during the compilation.
use "exclude": ["**/node_modules/*"] instead.
@mhegazy Thanks!
Created this https://github.com/Microsoft/TypeScript/issues/12824 to find out which behaviour is consistent and it should be documented carefully.
@rbuckton We've seen a number of reports of this issue on the VSCode side. I'm planning to update our documentation to use the "exclude": ["**/node_modules/*"] pattern
Can we please look into this for TS 2.5 as well
Most helpful comment
use
"exclude": ["**/node_modules/*"]instead.