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:
112
node_modules/stylelint/lib/rules/function-comma-newline-before/README.md
generated
vendored
Normal file
112
node_modules/stylelint/lib/rules/function-comma-newline-before/README.md
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
# function-comma-newline-before
|
||||
|
||||
Require a newline or disallow whitespace before the commas of functions.
|
||||
|
||||
```css
|
||||
a { transform: translate(1
|
||||
, 1) }
|
||||
/** ↑
|
||||
* These commas */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"always"|"always-multi-line"|"never-multi-line"`
|
||||
|
||||
### `"always"`
|
||||
|
||||
There *must always* be a newline before the commas.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a { transform: translate(1,1) }
|
||||
```
|
||||
|
||||
```css
|
||||
a { transform: translate(1 ,1) }
|
||||
```
|
||||
|
||||
```css
|
||||
a { transform: translate(1,
|
||||
1) }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a {
|
||||
transform: translate(1
|
||||
,1)
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
transform: translate(1
|
||||
, 1)
|
||||
}
|
||||
```
|
||||
|
||||
### `"always-multi-line"`
|
||||
|
||||
There *must always* be a newline before the commas in multi-line functions.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a { transform: translate(1,
|
||||
1) }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a { transform: translate(1,1) }
|
||||
```
|
||||
|
||||
```css
|
||||
a { transform: translate(1 ,1) }
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
transform: translate(1
|
||||
,1)
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
transform: translate(1
|
||||
, 1)
|
||||
}
|
||||
```
|
||||
|
||||
### `"never-multi-line"`
|
||||
|
||||
There *must never* be a whitespace before the commas in multi-line functions.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a { transform: translate(1 ,
|
||||
1) }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a { transform: translate(1 ,1) }
|
||||
```
|
||||
|
||||
```css
|
||||
a { transform: translate(1 , 1) }
|
||||
```
|
||||
|
||||
```css
|
||||
a {
|
||||
transform: translate(1,
|
||||
1)
|
||||
}
|
||||
```
|
42
node_modules/stylelint/lib/rules/function-comma-newline-before/index.js
generated
vendored
Normal file
42
node_modules/stylelint/lib/rules/function-comma-newline-before/index.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use strict"
|
||||
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
const whitespaceChecker = require("../../utils/whitespaceChecker")
|
||||
const functionCommaSpaceChecker = require("../functionCommaSpaceChecker")
|
||||
|
||||
const ruleName = "function-comma-newline-before"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expectedBefore: () => "Expected newline before \",\"",
|
||||
expectedBeforeMultiLine: () => "Expected newline before \",\" in a multi-line function",
|
||||
rejectedBeforeMultiLine: () => "Unexpected whitespace before \",\" in a multi-line function",
|
||||
})
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
functionCommaSpaceChecker({
|
||||
root,
|
||||
result,
|
||||
locationChecker: checker.beforeAllowingIndentation,
|
||||
checkedRuleName: ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user