TypeScript Version: 2.4.1
Code
{
"compilerOptions": {
"sourceMap": false,
"outDir": "./dist/",
"noImplicitAny": true,
"module": "commonjs",
"target": "es6",
"declaration": true,
"lib": ["es2016", "es7"]
},
"include": [
"./src/**/*"
]
}
+-- project
+-- node_modules
| + @types
| | + react
| | + react-router
| | + ...
| + ...
|
+-- frontend
| + MyReactApp.tsx
| + tsconfig.json
| + ...
|
+-- subproject
+ ReactThingy.ts
+ tsconfig.json
+ ...
Expected behavior:
My TS files should work fine
Actual behavior:
Instead, typescript, will look for definitions in node_modules in parent folders, so it will try to compile using @types/react-router and so. Thus, failing to compile.
This is the intended behavior. Please refer to http://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types for information on how to control this behavior in your _tsconfig.json_ file.
Most helpful comment
This is the intended behavior. Please refer to http://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types for information on how to control this behavior in your _tsconfig.json_ file.