skip to Main Content

I’m using VS Code with a number of different programming languages, which all have some form of problem validation provided via an extension. While these problem underlines are generally useful, I find them very annoying while I’m writing a particular piece of code, and only useful once I’m mostly done typing. I often think while writing code and I also tend to hit Ctrl+S very often, so there is no way that my IDE can "debounce" properly, as it wouldn’t be able to tell if I’m done writing code or not.

How can I disable all lints from being displayed, regardless of the programming language used, until I re-enable them (or restart Code or whatever)?

I’m not looking for a always-hidden solution that permanently changes my settings. More for something that I can toggle with a keyboard shortcut or similar.

While I am most interested in a solution that works regardless of where the lints come from, the two extensions that’d be responsible for most of my lints are rust-analyzer and Kotlin, but I also have clangd and TexLab installed and also use TypeScript whenever I can’t avoid it but currently I don’t have any extension for it installed.

4

Answers


  1. Override theme colors in settings.json

    {
      "workbench.colorCustomizations": {
        "[Visual Studio Light]": {
          "editorError.foreground": "#00000000"
        },
        "editorError.foreground": "#00ff00"
      }
    }
    

    will make errors transparent while using "Visual Studio Light" theme
    and lightgreen while using any other theme, for example

    Source: https://youtu.be/vR2y4VoCZg4?t=97

    Login or Signup to reply.
  2. I don’t think the exact thing you are looking for exists at the time of this writing.

    I am not aware of any "global" (programming-language-agnostic) setting that toggles showing underlines for problems in the editor view. There is a setting that toggles showing decorations for problems in the Explorer view (problems.decorations.enabled), but that’s not what you’re looking for.

    As shown by the answers to How to disable error highlighting in VS Code?, there are settings on a per-language basis to disable validation (such as css.validate, php.validate.enable, html.validate.*, json.validate.enable, java.validate.enable, etc. Note that language extensions may not follow that pattern of naming their settings fields, such as C_Cpp.errorSquiggles and python.linting.enabled)

    In terms of getting a keyboard shortcut to toggle such a setting (whether the currently-non-existent-(I-think) programming-language-agnostic setting, or an individual programming-language-specific setting), see this Q&A: VSCode: Keyboard shortcuts for modifying user settings, where @matt-bierner points to the rebornix.toggle extension, which allows configuring keyboard shortcuts to toggle individual bi-state settings fields.

    As for feature-requests and possible future features to VS Code, see this issue on the VS Code GitHub repo: Toggle problem visibility in Editor #166797. You can show your support for the issue ticket by giving a thumbs up reaction to the issue. But please don’t make a "me too" comment. "me too" comments generally come off as annoying to repo maintainers because they clutter up discussion and don’t contribute anything of significant value.

    Login or Signup to reply.
  3. with the extension When File you can make the squiggles transparent when the file is dirty.

    Add this to your settings.json file (global or workspace/folder)

    "whenFile.change": {
      "whenDirty": {
        "editorError.foreground": "#ff000020",
        "editorWarning.foreground": "#ff000020",
        "editorInfo.foreground": "#ff000020"
      }
    }
    
    Login or Signup to reply.
  4. File add a new line css. Lint dot empty rules and assign the value of ignore.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search