1

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).

enter image description here

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:

enter image description here

Setting not seen in GUI:

<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>

From this thread:

Where can I find the TypeScript version installed in Visual Studio?

Ogglas
  • 62,132
  • 37
  • 328
  • 418

1 Answers1

0

Solved it with another error I saw:

Please install the 'Microsoft.TypeScript.MSBuild' NuGet package to enable TypeScript compilation in your project. You can use the NuGet Package Manager to do so. Project.Web

After installing the NuGet below everything started working:

https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild/4.6.4

At first I saw:

Using TypeScript 4.3 for IntelliSense.
Using TypeScript 4.6 for IntelliSense.

But after restarting Visual Studio everything looked good:

Using TypeScript 4.6 for IntelliSense.
Ogglas
  • 62,132
  • 37
  • 328
  • 418