VSCode associate JavaScript files as Typescript incorrectly, how to fix it

Viewed 20

In Visual Studio Code, I keep getting errors on my JavaScript files from 'ts' attached. tsError on js files

Currently, I have two solutions:

  • Putting // @ts-nocheck at the top of each .js file
  • Putting "javascript.validate.enable": false in my user settings.json in VSC.

I don't like any of them, because the underlying problem is VSC associate my js files incorrectly as TypeScript files. How to tell VSC to change this behavior? Thanks!

I uninstalled the typescript packages that I installed before as well by running npm uninstall -g ts-node typescript. It did not help.

0 Answers
Related