Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
media-feature-name-value-no-unknown
(#6906)
* wip * first working draft * Create real-dingos-boil.md * note 1 * increase test coverage * increase coverage * increase test coverage * cleanup * improve code comments * cleanup and a few more tests * increase test coverage * Apply suggestions from code review Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> * Update lib/rules/media-feature-name-value-no-unknown/index.js Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> * Update lib/rules/media-feature-name-value-no-unknown/index.js Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> * apply suggestions from code review * refactor : add resolutionUnits to reference/units * Update lib/reference/units.js Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> * fix endIndex offset --------- Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
- Loading branch information
1 parent
7f51872
commit cbc0b6e
Showing
10 changed files
with
760 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"stylelint": minor | ||
--- | ||
|
||
Added: `media-feature-name-value-no-unknown` |
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
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,57 @@ | ||
# media-feature-name-value-no-unknown | ||
|
||
Disallow unknown values for media features. | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
@media (color: red) {} | ||
/** ↑ ↑ | ||
* feature and value pairs like these */ | ||
``` | ||
|
||
This rule considers values for media features defined within the CSS specifications to be known. | ||
|
||
This rule is only appropriate for CSS. You should not turn it on for CSS-like languages, such as Sass or Less, as they have their own syntaxes. | ||
|
||
This rule is experimental with some false negatives that we'll patch in minor releases. | ||
|
||
It sometimes overlaps with: | ||
|
||
- [`unit-no-unknown`](../unit-no-unknown/README.md) | ||
|
||
If duplicate problems are flagged, you can turn off the corresponding rule. | ||
|
||
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 --> | ||
```css | ||
@media (color: red) { top: 1px; } | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
@media (width: 10) { top: 1px; } | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
@media (width: auto) { top: 1px; } | ||
``` | ||
|
||
The following patterns are _not_ considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
@media (color: 8) { top: 1px; } | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
@media (width: 10px) { top: 1px; } | ||
``` |
Oops, something went wrong.