skip to Main Content

My VSCODE shows warnings as if they were errors (specifically linter warnings).

warning message shows as error

I want linter warnings to show with different unerline color. I tried modifying my settings.json adding the following configuration

    "workbench.colorCustomizations": {
        "editorError.foreground": "#ff0000",
        "editorWarning.foreground": "#ffc400",
        "editorInfo.foreground": "#35ffab"
    },

But it seems like VSCODE thinks that those are not warnings but errors

2

Answers


  1. Chosen as BEST ANSWER

    Figured it out.

    Turns out for some reason the default Typescript linter (that shows warnings properly) was disabled.
    Eslint was the culprit showing warnings as error (which makes sense, considering it's a linter that by definition should fail if there are lint issues)
    After disabling ESLint and enabling the built in default validator (image attached)

    Enabling default validator

    Warnings show up correctly now (without red underlines/errors in the problems window) enter image description here


  2. By default @typescript-eslint/no-unused-vars‘s level is error.

    To downgrade this to a warning, you can change your .eslintrc.js :

    module.exports = {
      ...
      rules: {
        ...
        "@typescript-eslint/no-unused-vars": ["warn"]
      }
    }
    

    NB: You may have to restart your vscode to see the changes

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