added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
@@ -0,0 +1,63 @@
# at-rule-semicolon-newline-after
Require a newline after the semicolon of at-rules.
<!-- prettier-ignore -->
```css
@import url("x.css");
@import url("y.css");
/** ↑
* The newline after these semicolons */
```
This rule allows an end-of-line comment followed by a newline. For example:
<!-- prettier-ignore -->
```css
@import url("x.css"); /* end-of-line comment */
a {}
```
The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
## Options
`string`: `"always"`
### `"always"`
There _must always_ be a newline after the semicolon.
The following patterns are considered violations:
<!-- prettier-ignore -->
```css
@import url("x.css"); @import url("y.css");
```
<!-- prettier-ignore -->
```css
@import url("x.css"); a {}
```
The following patterns are _not_ considered violations:
<!-- prettier-ignore -->
```css
@import url("x.css");
@import url("y.css");
```
<!-- prettier-ignore -->
```css
@import url("x.css"); /* end-of-line comment */
a {}
```
<!-- prettier-ignore -->
```css
@import url("x.css");
a {}
```
@@ -0,0 +1,78 @@
// @ts-nocheck
'use strict';
const hasBlock = require('../../utils/hasBlock');
const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule');
const nextNonCommentNode = require('../../utils/nextNonCommentNode');
const rawNodeString = require('../../utils/rawNodeString');
const report = require('../../utils/report');
const ruleMessages = require('../../utils/ruleMessages');
const validateOptions = require('../../utils/validateOptions');
const whitespaceChecker = require('../../utils/whitespaceChecker');
const ruleName = 'at-rule-semicolon-newline-after';
const messages = ruleMessages(ruleName, {
expectedAfter: () => 'Expected newline after ";"',
});
function rule(actual, secondary, context) {
const checker = whitespaceChecker('newline', actual, messages);
return (root, result) => {
const validOptions = validateOptions(result, ruleName, {
actual,
possible: ['always'],
});
if (!validOptions) {
return;
}
root.walkAtRules((atRule) => {
const nextNode = atRule.next();
if (!nextNode) {
return;
}
if (hasBlock(atRule)) {
return;
}
if (!isStandardSyntaxAtRule(atRule)) {
return;
}
// Allow an end-of-line comment
const nodeToCheck = nextNonCommentNode(nextNode);
if (!nodeToCheck) {
return;
}
checker.afterOneOnly({
source: rawNodeString(nodeToCheck),
index: -1,
err: (msg) => {
if (context.fix) {
nodeToCheck.raws.before = context.newline + nodeToCheck.raws.before;
} else {
report({
message: msg,
node: atRule,
index: atRule.toString().length + 1,
result,
ruleName,
});
}
},
});
});
};
}
rule.ruleName = ruleName;
rule.messages = messages;
module.exports = rule;