A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
- Run
Install Extension
command from Command Palette. - Search and choose
stylelint
.
See the extension installation guide for details.
Enable the linter in the VS Code settings, while disabling the built-in CSS and SCSS linter:
{
"stylelint.enable": true,
"css.validate": false,
"scss.validate": false
}
In addition to the VS Code settings mentioned below, you can set the config by adding stylelint configuration files to the workspace directory.
Type: Boolean
Default: true
Control whether stylelint is enabled for CSS/SCSS/Less files or not.
Type: Object
Default: null
Will be directly passed to configOverrides
option.
Type: Object
Default: null
Will be directly passed to config
option. Note that if you set config
option, this plugin ignores all the stylelint configuration files.
Type: Array
Default: []
Document types that you can use to run stylelint against if you are using CSS inside document types like: javascriptreact
, typescriptreact
or vue
.
Type: String
Default: null
Stylelint needs a custom parser for scss and less files. If the file you are linting is a .less or .scss file, no worries, this vscode-stylelint will automatically configure stylelint for you. However, if you have are trying to lint a file that is not on of those file types but still uses less or scss syntax, you must specify the syntax with this option.
Copyright (c) 2015 - 2017 Shinnosuke Watanabe
Licensed under the MIT License.