Skip to content

florianuphoff/stylelint-no-undoing-styles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published