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:
29
node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/README.md
generated
vendored
Normal file
29
node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/README.md
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# no-missing-end-of-source-newline
|
||||
|
||||
Disallow missing end-of-source newlines.
|
||||
|
||||
```css
|
||||
a { color: pink; }
|
||||
\n
|
||||
/** ↑
|
||||
* This newline */
|
||||
```
|
||||
|
||||
Completely empty files are not considered warnings.
|
||||
|
||||
## Options
|
||||
|
||||
### `true`
|
||||
|
||||
The following patterns are considered warnings:
|
||||
|
||||
```css
|
||||
a { color: pink; }
|
||||
```
|
||||
|
||||
The following patterns are *not* considered warnings:
|
||||
|
||||
```css
|
||||
a { color: pink; }
|
||||
\n
|
||||
```
|
37
node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js
generated
vendored
Normal file
37
node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict"
|
||||
|
||||
const report = require("../../utils/report")
|
||||
const ruleMessages = require("../../utils/ruleMessages")
|
||||
const validateOptions = require("../../utils/validateOptions")
|
||||
|
||||
const ruleName = "no-missing-end-of-source-newline"
|
||||
|
||||
const messages = ruleMessages(ruleName, {
|
||||
rejected: "Unexpected missing end-of-source newline",
|
||||
})
|
||||
|
||||
const rule = function (actual) {
|
||||
return (root, result) => {
|
||||
const validOptions = validateOptions(result, ruleName, { actual })
|
||||
if (!validOptions) {
|
||||
return
|
||||
}
|
||||
|
||||
const sourceCss = root.source.input.css
|
||||
if (sourceCss === "" || sourceCss.slice(-1) === "\n") {
|
||||
return
|
||||
}
|
||||
|
||||
report({
|
||||
message: messages.rejected,
|
||||
node: root,
|
||||
index: sourceCss.length - 1,
|
||||
result,
|
||||
ruleName,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
rule.ruleName = ruleName
|
||||
rule.messages = messages
|
||||
module.exports = rule
|
Reference in New Issue
Block a user