mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Initial commit
This commit is contained in:
95
node_modules/stylelint/lib/rules/selector-list-comma-space-after/README.md
generated
vendored
Normal file
95
node_modules/stylelint/lib/rules/selector-list-comma-space-after/README.md
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
# selector-list-comma-space-after
|
||||
|
||||
Require a single space or disallow whitespace after the commas of selector lists.
|
||||
|
||||
```css
|
||||
a, b { color: pink; }
|
||||
/** ↑
|
||||
* The space after this comma */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"always"|"never"|"always-single-line"|"never-single-line"`
|
||||
|
||||
### `"always"`
|
||||
|
||||
There *must always* be a single space after the commas.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a,b { color: pink; }
|
||||
```
|
||||
|
||||
```css
|
||||
a ,b { color: pink; }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a, b { color: pink; }
|
||||
```
|
||||
|
||||
```css
|
||||
a , b { color: pink; }
|
||||
```
|
||||
|
||||
### `"never"`
|
||||
|
||||
There *must never* be whitespace after the commas.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a, b { color: pink; }
|
||||
```
|
||||
|
||||
```css
|
||||
a , b { color: pink; }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a,b { color: pink; }
|
||||
```
|
||||
|
||||
```css
|
||||
a ,b { color: pink; }
|
||||
```
|
||||
|
||||
### `"always-single-line"`
|
||||
|
||||
There *must always* be a single space after the commas in single-line selector lists.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a,b { color: pink; }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a
|
||||
,b { color: pink; }
|
||||
```
|
||||
|
||||
### `"never-single-line"`
|
||||
|
||||
There *must never* be a single space after the commas in single-line selector lists.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a, b { color: pink; }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a
|
||||
, b { color: pink; }
|
||||
```
|
44
node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js
generated
vendored
Normal file
44
node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict"
|
||||
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
const whitespaceChecker = require("../../utils/whitespaceChecker")
|
||||
const selectorListCommaWhitespaceChecker = require("../selectorListCommaWhitespaceChecker")
|
||||
|
||||
const ruleName = "selector-list-comma-space-after"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expectedAfter: () => "Expected single space after \",\"",
|
||||
rejectedAfter: () => "Unexpected whitespace after \",\"",
|
||||
expectedAfterSingleLine: () => "Expected single space after \",\" in a single-line list",
|
||||
rejectedAfterSingleLine: () => "Unexpected whitespace after \",\" in a single-line list",
|
||||
})
|
||||
|
||||
const rule = function (expectation) {
|
||||
const checker = whitespaceChecker("space", expectation, messages)
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: expectation,
|
||||
possible: [
|
||||
"always",
|
||||
"never",
|
||||
"always-single-line",
|
||||
"never-single-line",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
selectorListCommaWhitespaceChecker({
|
||||
root,
|
||||
result,
|
||||
locationChecker: checker.after,
|
||||
checkedRuleName: ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user