stylelint-no-undoing-styles

1.2.1 • Public • Published

stylelint-no-undoing-styles

NPM version

This plugin finds any usage of undoing styles in your (s)css files and reports them.

Install

npm install stylelint-no-undoing-styles  --save-dev

Usage

After that add this plugin to your stylelint plugins and include the rule:

"plugins": [
  "stylelint-no-undoing-styles"
],
"rules": {
  "plugin/no-undoing-styles": true
}

Details

// _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.

Options

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):

  • 0
  • auto
  • none
  • baseline
  • initial

License

MIT

Package Sidebar

Install

npm i stylelint-no-undoing-styles

Weekly Downloads

0

Version

1.2.1

License

MIT

Unpacked Size

6.52 kB

Total Files

4

Last publish

Collaborators

  • florianuphoff