vscode-stylelint 2.x is the first version of the extension to support Stylelint 17.x. It's also backwards compatible with older version of Stylelint, down to 14.x.
It requires VS Code version 1.103.0 or later.
See also: Stylelint 14 migration guide
vscode-stylelint 1.x expects to use Stylelint 14 at minimum. Usage with prior versions of Stylelint is no longer supported. While older versions may continue to work for a while, you may encounter unexpected behaviour. You should upgrade your copy of Stylelint to version 14 or later for the best experience.
The syntax and configOverrides options have been removed from Stylelint 14 and this extension. See the following section for information on how to use different syntaxes.
Unlike 0.x, 1.x no longer provides a copy of Stylelint bundled with the extension. Bundling Stylelint brought up many unwanted side effects and significantly increased the extension's size.
Starting with 1.x, vscode-stylelint will depend on having a copy of Stylelint installed in the open workspace (recommended) or globally (not recommended). If the extension doesn't seem to be linting any documents, make sure you have Stylelint installed.
The 0.x versions of this extension, which used Stylelint 13.x and prior, supported validating many different languages out of the box without any additional configuration. However, this added a lot of complexity and resulted in many cases of unwanted or unexpected behaviour.
In current versions of the extension, the extension only supports validating CSS and PostCSS out of the box and requires additional configuration to validate other languages. You will need to:
-
Install the PostCSS syntax for the language you want to validate into your workspace, e.g. postcss-scss.
-
Configure Stylelint to use the syntax by providing the module name in the
customSyntaxoption using overrides (or use the corresponding option in this extension's settings).Example Stylelint config:
module.exports = { overrides: [ { files: ["**/*.scss"], customSyntax: "postcss-scss" } ] };
-
Add the language identifiers for the documents you want to validate to the extension's workspace or user settings using the
stylelint.validateoption.Example VS Code config:
{ "stylelint.validate": ["css", "scss"] }