mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 21:33:32 -06:00
Initial commit
This commit is contained in:
43
node_modules/stylelint/lib/rules/comment-no-empty/README.md
generated
vendored
Normal file
43
node_modules/stylelint/lib/rules/comment-no-empty/README.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# comment-no-empty
|
||||
|
||||
Disallow empty comments.
|
||||
|
||||
```css
|
||||
/* */
|
||||
/** ↑
|
||||
* Comments like this */
|
||||
```
|
||||
|
||||
**Caveat:** Comments within *selector and value lists* are currently ignored.
|
||||
|
||||
## Options
|
||||
|
||||
### `true`
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
/**/
|
||||
```
|
||||
|
||||
```css
|
||||
/* */
|
||||
```
|
||||
|
||||
```css
|
||||
/*
|
||||
|
||||
*/
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
/* comment */
|
||||
```
|
||||
|
||||
```css
|
||||
/*
|
||||
* Multi-line Comment
|
||||
**/
|
||||
```
|
49
node_modules/stylelint/lib/rules/comment-no-empty/index.js
generated
vendored
Normal file
49
node_modules/stylelint/lib/rules/comment-no-empty/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 = "comment-no-empty"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
rejected: "Unexpected empty comment",
|
||||
})
|
||||
|
||||
const rule = function (actual) {
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, { actual })
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
root.walkComments(comment => {
|
||||
// To ignore inline SCSS comments
|
||||
if (
|
||||
comment.raws.inline
|
||||
|| comment.inline
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
// To ignore comments that are not empty
|
||||
if (
|
||||
comment.text
|
||||
&& comment.text.length !== 0
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
report({
|
||||
message: messages.rejected,
|
||||
node: comment,
|
||||
result,
|
||||
ruleName,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user