Stylelint wont mark errors in VSCode

Viewed 706

VScode doesn't show me any stylint errors.

package.json:

    ...
    "postcss": "^8.4.12",
    "postcss-scss": "^4.0.3",
    "stylelint": "^14.7.1",
    "stylelint-config-sass-guidelines": "^9.0.1",

.stylelintrc.json:

{
    "extends": "stylelint-config-sass-guidelines",
    "files": ["**/*.scss"],
    "customSyntax": "postcss-scss",
    "rules": {
        "color-named": "always-where-possible",
        "max-nesting-depth": 5,
        "selector-max-compound-selectors": 6,
        "selector-no-qualifying-type": [
            true,
            {
                "ignore": ["attribute", "class", "id"]
            }
        ],
        "selector-max-id": 1,
        "no-extra-semicolons": true
    }    
}

vscode settings.json

    ...
    "stylelint.enable": true,
    "css.validate": false,
    "scss.validate": false,
    "less.validate": false,

Thats all i have configured. Im on vscodestylelint 1.2.2. Stylelint it self works in console just fine, vscode just won't show any errors.

2 Answers

In my case this didn't work because I also had

"stylelint.config": {},

in settings.json, and once I changed it to

"stylelint.config": null,

it started working

Related