A Stylelint plugin that checks CSS property values ending with a comma.
It adds functions to only run unit tests on files that are different between two branches or on changed files that haven't yet been commited;
npm install stylelint-no-ending-comma-rule
Stylelint is allowing CSS property values ending with ,
. Example below:
.foo {
margin: 0,;
}
Although PostCSS considers this as something valid and actually compiles the final property as margin: 0;
, it looks a bit messy to have code like that on the codebase.
After applying this rule, Stylelint will declare that ending ,
as an error. If applying Stylelint's formatting, the code will be changed to the following:
.foo {
margin: 0;
}
Add no-ending-comma-rule
to your stylelint config plugins
array, then add "jagoncalves14/no-ending-comma-rule"
to your rules,
specifying the property for which you want to check the usage of variable.
Like so:
// .stylelintrc
{
"plugins": [
"stylelint-no-ending-comma-rule"
],
"rules": {
// ...
"jagoncalves14/stylelint-no-ending-comma-rule": true,
// ...
}
}
Note: If you project uses Prettier, its formatter actually solves this. This plugin is only recommended if your project's formatting is being solely treated by ESLint and Stylelint.
Whether you're helping us fix bugs, improve the docs, or spread the word, thank you! 💪 🧡 💙
Check out our Contributing Guide for ideas on contributing and setup steps.
Licensed under the MIT License.