Using Visual Studio 2022 17.1.3
I get a lot of TypeScript errors and the following warning:
Using TypeScript 3.6 for IntelliSense (newest installed is TypeScript 4.3).
Running npm run build
works fine and package.json
has a devDependencies
for "typescript": "^4.5.2"
The exact same project works on another computer so the setting is probably specific to Visual Studio.
tsconfig.json
looks like this:
{
"compilerOptions": {
"target": "es5",
"downlevelIteration": true,
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"sourceMap": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"plugins": [
{
"name": "typescript-tslint-plugin"
}
],
"include": [
"src"
]
}
.csproj
TypeScript values:
Setting not seen in GUI:
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
From this thread:
Where can I find the TypeScript version installed in Visual Studio?