This is my personal configuration for stylelint based on stylelint-config-standard and extended with my own preferences.
Install Stylelint and this configuration as development dependencies:
npm install stylelint stylelint-config-dnunez24 --save-dev
Create a .stylelintrc
file in your project root and extend from stylelint-config-dnunez24
. Override any of the default configuraiton settings as you please. Here's an example:
{
"extends": "stylelint-config-dnunez24",
"rules": {
"indentation": "tab",
"number-leading-zero": null,
"property-no-unknown": [ true, {
"ignoreProperties": [
"composes"
]
}],
"unit-whitelist": ["em", "rem", "s"]
}
}
Make sure the stylelint
executable is in your PATH
and run it against your stylesheets to test compliance against the style preferences.
stylelint src/css/**/*.css
TODO