mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 13:23:32 -06:00
Initial commit
This commit is contained in:
98
node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/README.md
generated
vendored
Normal file
98
node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/README.md
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
# media-query-list-comma-newline-after
|
||||
|
||||
Require a newline or disallow whitespace after the commas of media query lists.
|
||||
|
||||
```css
|
||||
@media screen and (color),
|
||||
projection {} /* ↑ */
|
||||
/** ↑
|
||||
* These commas */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"always"|"always-multi-line"|"never-multi-line"`
|
||||
|
||||
### `"always"`
|
||||
|
||||
There *must always* be a newline after the commas.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color), projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
, projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color),
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
### `"always-multi-line"`
|
||||
|
||||
There *must always* be a newline after the commas in multi-line media query lists.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
, projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color), projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color),
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
### `"never-multi-line"`
|
||||
|
||||
There *must never* be a white after the commas in multi-line media query lists.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color),
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,
|
||||
projection and (color) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@media screen and (color), projection and (color) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media screen and (color)
|
||||
,projection and (color) {}
|
||||
```
|
45
node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js
generated
vendored
Normal file
45
node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict"
|
||||
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
const whitespaceChecker = require("../../utils/whitespaceChecker")
|
||||
const mediaQueryListCommaWhitespaceChecker = require("../mediaQueryListCommaWhitespaceChecker")
|
||||
|
||||
const ruleName = "media-query-list-comma-newline-after"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expectedAfter: () => "Expected newline after \",\"",
|
||||
expectedAfterMultiLine: () => "Expected newline after \",\" in a multi-line list",
|
||||
rejectedAfterMultiLine: () => "Unexpected whitespace after \",\" in a multi-line list",
|
||||
})
|
||||
|
||||
const rule = function (expectation) {
|
||||
const checker = whitespaceChecker("newline", expectation, messages)
|
||||
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: expectation,
|
||||
possible: [
|
||||
"always",
|
||||
"always-multi-line",
|
||||
"never-multi-line",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
// Only check for the newline after the comma, while allowing
|
||||
// arbitrary indentation after the newline
|
||||
mediaQueryListCommaWhitespaceChecker({
|
||||
root,
|
||||
result,
|
||||
locationChecker: checker.afterOneOnly,
|
||||
checkedRuleName: ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user