stylelint-config-astro
A shareable Stylelint config for linting Astro (.astro
) files
The low down
This config bundles postcss-html and configures it to parse .astro files so you can use Stylelint
on the <style></style>
section within those components.
Minimum Requirements
This package is compatible with the following peer dependencies:
- stylelint v14.0.0 and above
- postcss-html v1.0.0 and above
Installation
# Using npm
npm install --save-dev postcss-html stylelint-config-astro
# Using Yarn
yarn add --dev postcss-html stylelint-config-astro
Usage
Append to the extends
array in your
.stylelintrc.*
file. It's usually best placed after your other rulesets.
{
"extends": [
// other configs ...
"stylelint-config-astro"
]
}
Integrations
Visual Studio Code
Use the official stylelint.vscode-stylelint extension.
Add the .astro
file extension to stylelint.validate
under settings to enable linting for Astro
files.
.vscode/settings.json:
{
"stylelint.validate": [
// other file extensions...
"astro"
]
}
Credits
Although this package is not a direct fork it heavily leverages the the work of @ota-meshi in stylelint-config-html.