Removing [ts] errors from JS files In VS Code

后端 未结 8 1058
有刺的猬
有刺的猬 2021-01-31 14:44

I get these TypeScript errors VS Code while I\'m working in JS files. Is there anything I can do to disable this? I have put this in my settings and did not solve the issue:

8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 15:35

    I don't have enough information about project setup and code, but it looks like you are trying to load .js files as typescript.

    To use JavaScript files in Typescript projects you must enable allowJs flag, either in command line --allowJs or in the tsconfig.json as "allowJs": true.

    But, if the .js files should not be part of the TS project but just are in the same directory tree, you need to review your exclude and include properties of tsconfig.json

提交回复
热议问题