stylelint Beautifier
About
stylelint beautifier for Unibeautify
Package | Docs | Latest |
---|---|---|
@unibeautify/beautifier-stylelint | v0.0.1 | |
stylelint | v13.3.3 | |
unibeautify | v0.17.1 |
Install
Install with npm
:
npm install --save-dev stylelint unibeautify @unibeautify/beautifier-stylelint
Or with yarn
:
yarn add --dev stylelint unibeautify @unibeautify/beautifier-stylelint
Usage
Add stylelint
to beautifiers
language option.
A .unibeautifyrc.json
file would look like the following:
{
"LANGUAGE_NAME": {
"beautifiers": [
"stylelint"
]
}
}
Note: The
LANGUAGE_NAME
should be replaced with your desired supported language name, such asCSS
,Less
,SCSS
, etc.
Advanced
The following beautifier option(s) are supported:
prefer_beautifier_config
See beautifier options docs for more information.
Example advanced configuration:
{
"LANGUAGE_NAME": {
"beautifiers": [
"stylelint"
],
"stylelint": {
"prefer_beautifier_config": true
}
}
}
Options
Option | CSS | Less | SCSS | Sass | SugarSS |
---|---|---|---|---|---|
End With Newline | ✅ | ✅ | ✅ | ✅ | ✅ |
Indent Size | ✅ | ✅ | ✅ | ✅ | ✅ |
Indent Style | ✅ | ✅ | ✅ | ✅ | ✅ |
Quotes | ✅ | ✅ | ✅ | ✅ | ✅ |
Remove Trailing Whitespace | ✅ | ✅ | ✅ | ✅ | ✅ |
Wrap Line Length | ✅ | ✅ | ✅ | ✅ | ✅ |
FAQ
How to use stylelint in Atom, VSCode, and other editors?
See the editor integration documentation for installation instructions for your editor of choice.
How to use stylelint configuration file?
You can override Unibeautify configuration and use stylelint's own configuration file instead with prefer_beautifier_config
beautifier option.
{
"LANGUAGE_NAME": {
"beautifiers": [
"stylelint"
],
"stylelint": {
"prefer_beautifier_config": "path/to/stylelint/config/file"
}
}
}
See beautifier options docs for more information.
How to enable stylelint to format on save?
See the editor integration documentation for format on save instructions for your editor of choice.
How to run stylelint on all files?
You can run stylelint on all of your files for every commit with Unibeautify CI.
Is there a stylelint sandbox or playground?
You can quickly try stylelint online with Unibeautify Playground.