Search code examples
visual-studio-codelintstylelint

VS Code style-lint ignore directories


Is it possible to ignore my CSS path, beacuse I only use stylelint for SCSS validation?

e.g. - I have the following structure:

assets/
    css/
    scss/

How can I disable the css/ folder from being indexed, trough the settings.json file of VSCode?

I found this in the docs, but I don't know how to implement it in VSCode.


Solution

  • If you're using the VS Code stylelint extension, you can specify ignore paths via the stylelint.configOverrides setting.

    Add the following to your VS Code settings.json file:

    "stylelint.configOverrides": {
        "ignoreFiles": "assets/css/**"
    }
    

    Alternatively you can add a .stylelintignore file to the root folder of your project and add the ignore paths there:

    assets/css/**