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:
45
node_modules/stylelint/lib/rules/at-rule-blacklist/README.md
generated
vendored
Normal file
45
node_modules/stylelint/lib/rules/at-rule-blacklist/README.md
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# at-rule-blacklist
|
||||
|
||||
Specify a blacklist of disallowed at-rules.
|
||||
|
||||
```css
|
||||
@keyframes name {}
|
||||
/** ↑
|
||||
* At-rules like this */
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
`array|string`: `["array", "of", "unprefixed", "at-rules"]|"at-rule"`
|
||||
|
||||
Given:
|
||||
|
||||
```js
|
||||
["extend", "keyframes"]
|
||||
```
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a { @extend placeholder; }
|
||||
```
|
||||
|
||||
```css
|
||||
@keyframes name {
|
||||
from { top: 10px; }
|
||||
to { top: 20px; }
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
@-moz-keyframes name {
|
||||
from { top: 10px; }
|
||||
to { top: 20px; }
|
||||
}
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
@import "path/to/file.css";
|
||||
```
|
48
node_modules/stylelint/lib/rules/at-rule-blacklist/index.js
generated
vendored
Normal file
48
node_modules/stylelint/lib/rules/at-rule-blacklist/index.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict"
|
||||
|
||||
const _ = require("lodash")
|
||||
const postcss = require("postcss")
|
||||
const report = require("../../utils/report")
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
|
||||
const ruleName = "at-rule-blacklist"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
rejected: name => `Unexpected at-rule "${name}"`,
|
||||
})
|
||||
|
||||
const rule = function (blacklistInput) {
|
||||
// To allow for just a string as a parameter (not only arrays of strings)
|
||||
const blacklist = [].concat(blacklistInput)
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, {
|
||||
actual: blacklist,
|
||||
possible: [_.isString],
|
||||
})
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
root.walkAtRules(atRule => {
|
||||
const name = atRule.name
|
||||
|
||||
if (blacklist.indexOf(postcss.vendor.unprefixed(name).toLowerCase()) === -1) {
|
||||
return
|
||||
}
|
||||
|
||||
report({
|
||||
message: messages.rejected(name),
|
||||
node: atRule,
|
||||
result,
|
||||
ruleName,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.primaryOptionArray = true
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user