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:
94
node_modules/stylelint/lib/rules/at-rule-name-newline-after/README.md
generated
vendored
Normal file
94
node_modules/stylelint/lib/rules/at-rule-name-newline-after/README.md
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
# at-rule-name-newline-after
|
||||
|
||||
Require a newline after at-rule names.
|
||||
|
||||
```css
|
||||
@media
|
||||
/*↑*/ (max-width: 600px) {}
|
||||
/** ↑
|
||||
* The newline after this at-rule name */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"always"|"always-multi-line"`
|
||||
|
||||
### `"always"`
|
||||
|
||||
There *must always* be a newline after at-rule names.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@charset "UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) and
|
||||
(orientation: landscape) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@charset
|
||||
"UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@import
|
||||
"x.css" screen and
|
||||
(orientation:landscape);
|
||||
```
|
||||
|
||||
```css
|
||||
@media
|
||||
(min-width: 700px) and (orientation: landscape) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media
|
||||
(min-width: 700px) and
|
||||
(orientation: landscape) {}
|
||||
```
|
||||
|
||||
### `"always-multi-line"`
|
||||
|
||||
There *must always* be a newline after at-rule names in at-rules with multi-line parameters.
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@import "x.css" screen and
|
||||
(orientation:landscape);
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) and
|
||||
(orientation: landscape) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@charset "UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@charset
|
||||
"UTF-8";
|
||||
```
|
||||
|
||||
```css
|
||||
@import "x.css" screen and (orientation:landscape);
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 700px) and (orientation: landscape) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media
|
||||
(min-width: 700px) and
|
||||
(orientation: landscape) {}
|
||||
```
|
39
node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js
generated
vendored
Normal file
39
node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict"
|
||||
|
||||
const atRuleNameSpaceChecker = require("../atRuleNameSpaceChecker")
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
const whitespaceChecker = require("../../utils/whitespaceChecker")
|
||||
|
||||
const ruleName = "at-rule-name-newline-after"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expectedAfter: name => `Expected newline after at-rule name \"${name}\"`,
|
||||
})
|
||||
|
||||
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",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
atRuleNameSpaceChecker({
|
||||
root,
|
||||
result,
|
||||
locationChecker: checker.afterOneOnly,
|
||||
checkedRuleName: ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user