How to disable TypeScript warnings in VSCode?

前端 未结 4 1632
别跟我提以往
别跟我提以往 2020-12-13 08:27

I don\'t use TypeScript for the time being. Only ES6 with babel.
I don\'t have installed TypeScript in node_modules.

I get a specific warning from VSCod

相关标签:
4条回答
  • 2020-12-13 08:47

    I was having a similar problem. I had an incorrect setting for typescript.tsdk in my user settings:

    "typescript.tsdk": null
    

    To fix it, you can either set the location to a valid location:

    "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib",
    

    or just remove the line from your settings if are not using Typescript.

    If you need more detail, I found the VSCode docs to be very concise and easy to understand.

    0 讨论(0)
  • 2020-12-13 08:59

    TypeScript and JavaScript validation can be turned off in VS Code with these two settings:

    "typescript.validate.enable": false,
    "javascript.validate.enable": false,
    

    Happy Coding

    0 讨论(0)
  • 2020-12-13 08:59
    1. open the command palette : CTRL + SHIFT + P

    2. open the file settings.json :

    1. add these 2 lines of code:

      "typescript.validate.enable": false,
      "javascript.validate.enable": false,
      
    0 讨论(0)
  • 2020-12-13 09:00

    If you want to modify a setting, open the settings option (there is a new settings editor by the time I am writing this) and search for the setting you want to modify. I was attempting to change the typescript validation, but I wasn't allowed as the document was read only. If you hover over the setting, you get a pen on the left of the setting. If you right click on the pen, it will give you the option of true or false, as for my case I was targeting "typescript.validate.enable". I changed it to false, which in turn, VS code copied the code into the right of the screen with the new value. In short, the left is the settings.json file. On the right, you have the user-settings.json. You are only allowed to modify the user settings and the user setting can override any settings in the main settings.json file. -Kf

    0 讨论(0)
提交回复
热议问题