notes/node_modules/stylelint/lib/rules/property-no-unknown/README.md

1.6 KiB

property-no-unknown

Disallow unknown properties.

a { heigth: 100%; }
/** ↑
 * These properties */

This rule considers properties defined in the CSS Specifications and browser specific properties to be known.

This rule ignores variables ($sass, @less, --custom-property).

This rule ignores vendor-prefixed properties (e.g., -moz-align-self, -webkit-align-self). Use option checkPrefixed described below to turn on checking of vendor-prefixed properties.

Options

true

The following patterns are considered warnings:

a {
  colr: blue;
}
a {
  my-property: 1;
}

The following patterns are not considered warnings:

a {
  color: green;
}
a {
  fill: black;
}
a {
  -moz-align-self: center;
}
a {
  -webkit-align-self: center;
}
a {
  align-self: center;
}

Optional secondary options

ignoreProperties: ["/regex/", "string"]

Given:

["/^my-/", "custom"]

The following patterns are not considered warnings:

a {
  my-property: 10px;
}
a {
  my-other-property: 10px;
}
a {
  custom: 10px;
}

checkPrefixed: true | false (default: false)

If true, this rule will check vendor-prefixed properties.

For example with true:

The following patterns are not considered warnings:

a {
  -webkit-overflow-scrolling: auto;
}
a {
  -moz-box-flex: 0;
}

The following patterns are considered warnings:

a {
  -moz-align-self: center;
}
a {
  -moz-overflow-scrolling: center;
}