Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9aa4449
commit 0347303
Showing
7 changed files
with
728 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
# property-no-unknown | ||
|
||
Disallow unknown properties. | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { height: 100%; } | ||
/** ↑ | ||
* This property */ | ||
``` | ||
|
||
This rule considers properties defined in the [CSS Specifications and browser specific properties](https://github.com/betit/known-css-properties#source) to be known. | ||
|
||
This rule ignores: | ||
|
||
- variables (`$sass`, `@less`, `--custom-property`) | ||
- vendor-prefixed properties (e.g., `-moz-align-self`, `-webkit-align-self`) | ||
|
||
Use option `checkPrefixed` described below to turn on checking of vendor-prefixed properties. | ||
|
||
The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. | ||
|
||
## Options | ||
|
||
### `true` | ||
|
||
The following patterns are considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
colr: blue; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
my-property: 1; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
font: { | ||
stuff: bold; | ||
} | ||
} | ||
``` | ||
|
||
The following patterns are _not_ considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
color: green; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
fill: black; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
-moz-align-self: center; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
-webkit-align-self: center; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
align-self: center; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
font: { | ||
weight: bold; | ||
} | ||
} | ||
``` | ||
|
||
## Optional secondary options | ||
|
||
### `ignoreProperties: ["/regex/", /regex/, "string"]` | ||
|
||
Given: | ||
|
||
```json | ||
["/^my-/", "custom"] | ||
``` | ||
|
||
The following patterns are _not_ considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
my-property: 10px; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
my-other-property: 10px; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
custom: 10px; | ||
} | ||
``` | ||
|
||
### `ignoreSelectors: ["/regex/", /regex/, "string"]` | ||
|
||
Skips checking properties of the given selectors against this rule. | ||
|
||
Given: | ||
|
||
```json | ||
[":root"] | ||
``` | ||
|
||
The following patterns are _not_ considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
:root { | ||
my-property: blue; | ||
} | ||
``` | ||
|
||
### `ignoreAtRules: ["/regex/", /regex/, "string"]` | ||
|
||
Ignores properties nested within specified at-rules. | ||
|
||
Given: | ||
|
||
```json | ||
["supports"] | ||
``` | ||
|
||
The following patterns are _not_ considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
@supports (display: grid) { | ||
a { | ||
my-property: 1; | ||
} | ||
} | ||
``` | ||
|
||
### `checkPrefixed: true | false` (default: `false`) | ||
|
||
If `true`, this rule will check vendor-prefixed properties. | ||
|
||
For example with `true`: | ||
|
||
The following patterns are _not_ considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
-webkit-overflow-scrolling: auto; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
-moz-box-flex: 0; | ||
} | ||
``` | ||
|
||
The following patterns are considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
-moz-align-self: center; | ||
} | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
a { | ||
-moz-overflow-scrolling: center; | ||
} | ||
``` |
Oops, something went wrong.