Rosenpin
Rosenpin

Reputation: 872

VSCODE shows warnings as errors

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

Upvotes: 2

Views: 2148

Answers (2)

Rosenpin
Rosenpin

Reputation: 872

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

Upvotes: 3

henry groves
henry groves

Reputation: 887

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

Upvotes: 3

Related Questions