VS Code style-lint ignore directories

2019-04-11 11:29发布

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.

2条回答
老娘就宠你
2楼-- · 2019-04-11 11:42

I'm using stylelint@9.2.0 with vscode-stylelint@0.20.4, and for me the .stylelintignore file is not being respected. If i use the CLI it is respected but the vscode plugin does not seem to do this correctly.

查看更多
冷血范
3楼-- · 2019-04-11 11:54

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/**
查看更多
登录 后发表回答