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,34 @@
# no-missing-end-of-source-newline
Disallow missing end-of-source newlines.
<!-- prettier-ignore -->
```css
a { color: pink; }
\n
/** ↑
* This newline */
```
Completely empty files are not considered violations.
The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
## Options
### `true`
The following patterns are considered violations:
<!-- prettier-ignore -->
```css
a { color: pink; }
```
The following patterns are _not_ considered violations:
<!-- prettier-ignore -->
```css
a { color: pink; }
\n
```
@@ -0,0 +1,52 @@
// @ts-nocheck
'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',
});
function rule(primary, _, context) {
return (root, result) => {
const validOptions = validateOptions(result, ruleName, { primary });
if (!validOptions) {
return;
}
if (root.source.inline || root.source.lang === 'object-literal') {
return;
}
const rootString = context.fix ? root.toString() : root.source.input.css;
if (!rootString.trim() || rootString.endsWith('\n')) {
return;
}
// Fix
if (context.fix) {
root.raws.after = context.newline;
return;
}
report({
message: messages.rejected,
node: root,
index: rootString.length - 1,
result,
ruleName,
});
};
}
rule.ruleName = ruleName;
rule.messages = messages;
module.exports = rule;