Visual Studio Code: [js] types can only be used in a .ts file

Can I use .js files in a typewriting project in code? I cloned a reactive project from the github repository and opened it in Visual Studio Code. When I add tsconfig.json to start using typing, I get a long list of errors. For example, here is the box.js file (with es6 functions):

enter image description here

Here is my tsconfig.json file (if I delete this file, then everything works fine, no errors are reported):

enter image description here

+8
source share
3 answers

Workaround - Add the following configuration to $workspace/.vscode/settings.json

{
    "javascript.validate.enable": false
}
+8
source

VS , ,

0

You can try it !!!

Install the Stream Language Support extension in Visual Studio code and disable TypeScript and JavaScript.

Search @Builtin TypeScript and JavaScript Language Features and restart.

You can see this solution fooobar.com/questions/15180653 / ...

Its important to set npm for flow

Link stream

0
source

Source: https://habr.com/ru/post/1664829/


All Articles