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
+113
View File
@@ -0,0 +1,113 @@
# function-comma-newline-after
Require a newline or disallow whitespace after the commas of functions.
<!-- prettier-ignore -->
```css
a { transform: translate(1,
1) } /* ↑ */
/** ↑
* These commas */
```
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-multi-line"|"never-multi-line"`
### `"always"`
There _must always_ be a newline after the commas.
The following patterns are considered violations:
<!-- prettier-ignore -->
```css
a { transform: translate(1,1) }
```
<!-- prettier-ignore -->
```css
a { transform: translate(1 ,1) }
```
<!-- prettier-ignore -->
```css
a { transform: translate(1
,1) }
```
The following patterns are _not_ considered violations:
<!-- prettier-ignore -->
```css
a {
transform: translate(1,
1)
}
```
### `"always-multi-line"`
There _must always_ be a newline after the commas in multi-line functions.
The following patterns are considered violations:
<!-- prettier-ignore -->
```css
a { transform: translate(1
,1) }
```
The following patterns are _not_ considered violations:
<!-- prettier-ignore -->
```css
a { transform: translate(1,1) }
```
<!-- prettier-ignore -->
```css
a { transform: translate(1 ,1) }
```
<!-- prettier-ignore -->
```css
a {
transform: translate(1,
1)
}
```
### `"never-multi-line"`
There _must never_ be whitespace after the commas in multi-line functions.
The following patterns are considered violations:
<!-- prettier-ignore -->
```css
a { transform: translate(1
, 1) }
```
The following patterns are _not_ considered violations:
<!-- prettier-ignore -->
```css
a { transform: translate(1, 1) }
```
<!-- prettier-ignore -->
```css
a { transform: translate(1 , 1) }
```
<!-- prettier-ignore -->
```css
a {
transform: translate(1
,1)
}
```
+55
View File
@@ -0,0 +1,55 @@
// @ts-nocheck
'use strict';
const fixer = require('../functionCommaSpaceFix');
const functionCommaSpaceChecker = require('../functionCommaSpaceChecker');
const ruleMessages = require('../../utils/ruleMessages');
const validateOptions = require('../../utils/validateOptions');
const whitespaceChecker = require('../../utils/whitespaceChecker');
const ruleName = 'function-comma-newline-after';
const messages = ruleMessages(ruleName, {
expectedAfter: () => 'Expected newline after ","',
expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line function',
rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line function',
});
function rule(expectation, options, context) {
const checker = whitespaceChecker('newline', expectation, messages);
return (root, result) => {
const validOptions = validateOptions(result, ruleName, {
actual: expectation,
possible: ['always', 'always-multi-line', 'never-multi-line'],
});
if (!validOptions) {
return;
}
functionCommaSpaceChecker({
root,
result,
locationChecker: checker.afterOneOnly,
checkedRuleName: ruleName,
fix: context.fix
? (div, index, nodes) => {
return fixer({
div,
index,
nodes,
expectation,
position: 'after',
symb: context.newline,
});
}
: null,
});
};
}
rule.ruleName = ruleName;
rule.messages = messages;
module.exports = rule;