1.0.0 • Published 2 years ago

stylelint-non-zero-length-expect-unit v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

stylelint-non-zero-length-expect-unit

The rule enforces unit if length is non-zero.

In styled-components/native >= v5, you will get a lot of warnings if the style does not have a unit. This rule allows you to statically detect where the warning occurs.

div {
  height: 100;
  /* ↑ Unit expected */
}

Installation

  npm install --save-dev stylelint stylelint-non-zero-length-expect-unit

or

  yarn add -D stylelint stylelint-non-zero-length-expect-unit

Useage

{
  "plugins": ["stylelint-non-zero-length-expect-unit"],
  "rules": {
    "plugin/non-zero-length-expect-unit": true
  }
}