This plugin finds any usage of undoing styles in your (s)css files and reports them.
MIT License
This plugin finds any usage of undoing styles in your (s)css files and reports them.
npm install stylelint-no-undoing-styles --save-dev
After that add this plugin to your stylelint plugins and include the rule:
"plugins": [
"stylelint-no-undoing-styles"
],
"rules": {
"plugin/no-undoing-styles": true
}
// _button.scss
.fancy-button {
margin-bottom: 2em;
}
// _landingpage.scss
.fancy_button {
margin-bottom: 0;
}
/** ^^^
* Undoing styles from _button.scss */
Be cautions with warnings: not every warning is truthy. The static analysis might have false positives or reports neccessary resetting declarations.
true
The following pattern is considered warning:
// _button.scss
.fancy-button {
border: 0.5em solid #F00;
}
// _landingpage.scss
.fancy_button {
border: none;
}
Resetting values (not always):
MIT