Legotin
Legotin

Reputation: 2688

Disable (or toggle) the wavy underline/squigglies (problems) in VS Code


I'm using Visual Studio Code (v1.11.2).
Is there any way to disable wavy underline at all?

enter image description here

Upvotes: 85

Views: 161468

Answers (11)

Mark
Mark

Reputation: 181050

There is a new setting in Insiders v1.85 to hide the Problems squigglies in the editors and the editor tabs and the Explorer (see demo below).

The setting is:

Problems: Visibility
Controls whether the problems are visible throughout the editor and workbench.

Unfortunately, it is a setting only and not a command that can TOGGLE the problems visibility on and off quickly.

If you want to be able to quickly toggle it on and off by a keybinding, you will need an extension such as Toggle, written by a then-vscode team member - there may be other toggle settings extensions.

Here is a keybinding (in your keybindings.json) that will toggle the Problems: Visibility setting on and off:

{
  "key": "alt+t",           // whatever keybinding you want
  "command": "toggle",
  "when": "editorTextFocus",
  "args": {
      "id": "problems",
      "value": [
          {
            "problems.visibility": false
          },
          {
            "problems.visibility": true
          }
      ]
  }
}

Demo showing the setting working:

problems visibility setting

Demo of the Toggle keybinding:

Problems visibility toggle

When the Problems: Visibility setting is off, there will be a small notification in the Taskbar which when clicked will take you to the Setting UI with that setting:

Problems visibility disabled taskbar notification

The Toggle extension keybinding will also cause this taskBar notification to appear.



Previous answer:

A suggestion to upvote this more recent GH Issue: Provide the ability to disable warning/error squiggles. It is a backlog candidate but needs votes so that disabling the squigglies can be done across languages without resorting to the transparent trick.

Also definitely upvote Toggle problem visibility in Editor: same issue, already on the Backlog.

Upvotes: 6

Dmitry Demidovsky
Dmitry Demidovsky

Reputation: 8197

To disable wavy/squiggly underline in vscode, go to settings.json (Ctrl + Shift + P to access the Command Palette and type “settings.json”) and set underline color to fully transparent:

{
    "workbench.colorCustomizations": {
        "editorError.foreground":   "#00000000",
        "editorWarning.foreground": "#00000000",
        "editorInfo.foreground":    "#00000000"
    }
}

Though it may be better to make underline color just less vibrant:

{
    "workbench.colorCustomizations": {
        "editorError.foreground":   "#ff000088",
        "editorWarning.foreground": "#ffe60033",
        "editorInfo.foreground":    "#00ff0088"
    }
}

Upvotes: 153

rob_7cc
rob_7cc

Reputation: 917

For Python, using VS Code circa v1.78.2, this worked:

  • Navigate to Extensions
  • Find Pylint, click the gear icon and select Disable
  • Find Pylance, click the gear icon and select Disable
  • Restart of VS Code was required and disabling both Pylint and Pylance was required

Upvotes: 0

Naveen Saini
Naveen Saini

Reputation: 31

If in dart in the flutter project, blue wavy lines are coming all over the code in the dart file, then make sure that you have saved the file with a name that contains lowercase and underscore characters only.

Upvotes: 0

Fed
Fed

Reputation: 1875

If you are using Ruby and those are the files that you want to disable the warnings for, open the preferences file settings.json and modify the ruby linting rules as follows:

    "ruby.lint":
    {
        "rubocop": false
    },

Upvotes: 0

Matthias Fripp
Matthias Fripp

Reputation: 18625

When using Python, the common advice is to use shift-ctrl/cmd-P, then set Python: Enable/Disable Linting > Disable and Python: Select Linter > Disable Linting. Neither of those was enough for me. Nor was I able to disable these by turning off the dozen or so linters listed under Settings > search > linting.

However, I was finally able to disable the wavy red underlines via Settings > Python: Language Server > None.

By the way, you can see where these underlines are coming from via View > Problems. In my case, they were coming from PyLance, and after I removed that extension, they came from Jedi instead. Even though I don't have the Jedi installed. It seems like Microsoft's own Python extension has Jedi somewhere inside and uses that unless you turn off the Language Server entirely.

Upvotes: 4

Aamir Naved
Aamir Naved

Reputation: 129

Right Click in your editor window and select for 'Command Pallet' option

OR press CTRL+SHIFT+P and search for the option 'Enable Error Squiggle' and just click on it. That's it! If you want to Disable Red Wavy underlines showed after syntax error, just Follow the above procedure and search for 'Disable Error Squiggle' and click on it.

Upvotes: -2

Mayur Gupta
Mayur Gupta

Reputation: 519

Disable wavy underline in VS Code in C on mac

  1. Press command+shift+p (open command pallete)
  2. Then type Disable Error Squiggles
  3. And click on that Disable Error Squiggles

Your squiggles are no more

If you want to restart squiggles for some reason then in command pallete type Enable Error Squiggles

Upvotes: -6

Yao Li
Yao Li

Reputation: 2276

VSC Version: 1.45.1

Solution: Disable "JavaScript ESLint Enable" for JavaScript files.

  1. Open Command Palette by 'Ctrl+Shift+P'.
  2. From Command Palette find and click: 'Preferences: Open Workspace Settings'.
  3. From 'Workspace Settings' into search field type 'javascript'. From left sidebar look for Extensions -> ESLint.
  4. Click 'ESLint' and from right look for 'ESLint: Enable'.
  5. Uncheck 'ESLint Enable'.

enter image description here

Upvotes: 3

Ted
Ted

Reputation: 923

Scenario: VScode 1.35.1 with installed extension "StandardJS - JavaScript Standard Style".

  1. The extension in javascript files: underlines some code, checks for indent spaces, etc.

  2. How to stop javascript code style validation ?

Solution: Disable "JavaScript Standard Style" for JavaScript files.

  1. Open Command Palette by 'Ctrl+Shift+P'.

  2. From Command Palette find and click: 'Preferences: Open Workspace Settings'.

  3. From 'Workspace Settings' into search field type 'javascript'. From left sidebar look for Extensions -> JavaScript Standard Style.

  4. Click 'JavaScript Standard Style' and from right look for 'Standard: Enable'.

  5. Uncheck 'Standard Enable'.

Upvotes: 1

Abdullah Leghari
Abdullah Leghari

Reputation: 2470

In VSCode, those green squiggly lines mean a warning in your code. VSCode performs background code analysis(Linting) in order to provide you feedback about syntax and compilation errors.

In your particular case it is caused because of an empty CSS ruleset (declaring a selector but no properties). You can see the warning message by hovering mouse pointer over code with the green squiggly line underneath.

warning message VScode

You can disable the wavyline by disabling linting for CSS.

Go to File --> Preferences --> Settings and then place following line in Settings.json

"css.validate": false

Alternatively you can also change default behavior of empty ruleset which is "css.lint.emptyRules": "warning" to ignore VSCode settings.json There are also options to disable validating HTML and JavaScript code.

Upvotes: 12

Related Questions