I am using VScode with several react apps. For one of my projects, in the .js files I do not get the "Cannot find module 'typescript'. ts(2307)" alert on import something from './an/incorrect/path' lines, where I would expect that ts2307 alert.
However I do get that alert in .ts files that import from incorrect paths.
How do I get those alerts to appear as well in .js files?
I've checked that both of these settings are set to true in VScode settings.json. You want to change these two settings in VS Code's settings.json:
"typescript.validate.enable": true,
"javascript.validate.enable": true,
This is my tsconfig file.
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"lib": ["es2017", "dom"],
"allowJs": true,
"jsx": "react",
"noImplicitAny": false,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "lib"
},
"include": ["./**/*"]
}