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,50 @@
# at-rule-semicolon-space-before
Require a single space or disallow whitespace before the semicolons of at-rules.
<!-- prettier-ignore -->
```css
@import "components/buttons";
/** ↑
* The space before this semicolon */
```
## Options
`string`: `"always"|"never"`
### `"always"`
There _must always_ be a single space before the semicolons.
The following pattern is considered a violation:
<!-- prettier-ignore -->
```css
@import "components/buttons";
```
The following pattern is _not_ considered a violation:
<!-- prettier-ignore -->
```css
@import "components/buttons" ;
```
### `"never"`
There _must never_ be a single space before the semicolons.
The following pattern is considered a violation:
<!-- prettier-ignore -->
```css
@import "components/buttons" ;
```
The following pattern is _not_ considered a violation:
<!-- prettier-ignore -->
```css
@import "components/buttons";
```
@@ -0,0 +1,63 @@
// @ts-nocheck
'use strict';
const hasBlock = require('../../utils/hasBlock');
const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule');
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-space-before';
const messages = ruleMessages(ruleName, {
expectedBefore: () => 'Expected single space before ";"',
rejectedBefore: () => 'Unexpected whitespace before ";"',
});
function rule(expectation) {
const checker = whitespaceChecker('space', expectation, messages);
return (root, result) => {
const validOptions = validateOptions(result, ruleName, {
actual: expectation,
possible: ['always', 'never'],
});
if (!validOptions) {
return;
}
root.walkAtRules((atRule) => {
if (hasBlock(atRule)) {
return;
}
if (!isStandardSyntaxAtRule(atRule)) {
return;
}
const nodeString = rawNodeString(atRule);
checker.before({
source: nodeString,
index: nodeString.length,
err: (m) => {
report({
message: m,
node: atRule,
index: nodeString.length - 1,
result,
ruleName,
});
},
});
});
};
}
rule.ruleName = ruleName;
rule.messages = messages;
module.exports = rule;