mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-14 05:43:33 -06:00
Initial commit
This commit is contained in:
91
node_modules/stylelint/lib/rules/at-rule-name-case/README.md
generated
vendored
Normal file
91
node_modules/stylelint/lib/rules/at-rule-name-case/README.md
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
# at-rule-name-case
|
||||
|
||||
Specify lowercase or uppercase for at-rules names.
|
||||
|
||||
```css
|
||||
@media (min-width: 10px) {}
|
||||
/** ↑
|
||||
* These at-rule names */
|
||||
```
|
||||
|
||||
Only lowercase at-rule names are valid in SCSS.
|
||||
|
||||
## Options
|
||||
|
||||
`string`: `"lower"|"upper"`
|
||||
|
||||
### `"lower"`
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@Charset 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@cHarSeT 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@CHARSET 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@Media (min-width: 50em) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@mEdIa (min-width: 50em) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@MEDIA (min-width: 50em) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@charset 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 50em) {}
|
||||
```
|
||||
|
||||
### `"upper"`
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
@Charset 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@cHarSeT 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@charset 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@Media (min-width: 50em) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@mEdIa (min-width: 50em) {}
|
||||
```
|
||||
|
||||
```css
|
||||
@media (min-width: 50em) {}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@CHARSET 'UTF-8';
|
||||
```
|
||||
|
||||
```css
|
||||
@MEDIA (min-width: 50em) {}
|
||||
```
|
49
node_modules/stylelint/lib/rules/at-rule-name-case/index.js
generated
vendored
Normal file
49
node_modules/stylelint/lib/rules/at-rule-name-case/index.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict"
|
||||
|
||||
const report = require("../../utils/report")
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
|
||||
const ruleName = "at-rule-name-case"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`,
|
||||
})
|
||||
|
||||
const rule = function (expectation) {
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: expectation,
|
||||
possible: [
|
||||
"lower",
|
||||
"upper",
|
||||
],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
root.walkAtRules(atRule => {
|
||||
const name = atRule.name
|
||||
|
||||
const expectedName = expectation === "lower"
|
||||
? name.toLowerCase()
|
||||
: name.toUpperCase()
|
||||
|
||||
if (name === expectedName) {
|
||||
return
|
||||
}
|
||||
|
||||
report({
|
||||
message: messages.expected(name, expectedName),
|
||||
node: atRule,
|
||||
ruleName,
|
||||
result,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user