1.0.1 • Published 8 years ago

stylelint-property-unknown v1.0.1

Weekly downloads
65
License
MIT
Repository
github
Last release
8 years ago

stylelint-property-unknown

Build Status

A stylelint custom rule to catch usage of unknown properties.

This rule will cause stylelint to warn you whenever an unknown property is used.

Installation

npm install stylelint-property-unknown

This plugin is compatible with v5.0.1+.

Details

a { /* OK */
  margin-bottom: 0
}

a { /* Not OK */
  bottom-margin: 0
}

This ignores vendor-prefixed properties and variables.

Any property beginning $ or - is ignored. This will allow for variables or vendor specific properties to be used without error.

a {
  -webkit-foo: bar
}

a {
  @variableProperty: value
}

I did this because performance would be affected by including vendor-prefixed properties in the property whitelist, and that list would be much more difficult to maintain.

Usage

Add "stylelint-property-unknown" to your stylelint config plugins array, then add property-unknown to your rules, set to true.

As follows:

{
  "plugins": [
    "stylelint-property-unknown"
  ],
  "rules": {
    "property-unknown": true
  }
};