メインコンテンツにスキップ

property-no-unknown

不明なプロパティを許可しません。

a { height: 100%; }
/** ↑
* This property */

このルールでは、CSS仕様とブラウザ固有のプロパティで定義されたプロパティを既知のものとみなします。

このルールは以下を無視します

  • 変数($sass@less--custom-property
  • ベンダープレフィックス付きプロパティ(例:-moz-align-self-webkit-align-self

ベンダープレフィックス付きプロパティのチェックをオンにするには、以下で説明するcheckPrefixedオプションを使用してください。

message セカンダリオプションは、このルールの引数を受け入れることができます。

オプション

true

次のパターンは問題とみなされます

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

次のパターンは問題とはみなされません

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

オプションのセカンダリオプション

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

指定した場合

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

次のパターンは問題とはみなされません

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

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

このルールに対して、指定されたセレクタのプロパティのチェックをスキップします。

指定した場合

[":root"]

次のパターンは問題とはみなされません

:root {
my-property: blue;
}

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

指定された @規則内でネストされたプロパティを無視します。

指定した場合

["supports"]

次のパターンは問題とはみなされません

@supports (display: grid) {
a {
my-property: 1;
}
}

checkPrefixed: true | false (デフォルト: false)

trueの場合、このルールはベンダープレフィックス付きプロパティをチェックします。

たとえば、trueの場合

次のパターンは問題とはみなされません

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

次のパターンは問題とみなされます

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