eslint-plugin-putout 13.10.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -47
- package/lib/evaluate/README.md +8 -10
- package/lib/evaluate/index.js +5 -3
- package/lib/function-declaration-paren-newline/README.md +3 -2
- package/lib/index.js +4 -1
- package/lib/putout/README.md +1 -5
- package/lib/remove-empty-newline-after-last-element/README.md +23 -0
- package/lib/remove-empty-newline-after-last-element/index.js +20 -0
- package/lib/remove-empty-newline-after-last-specifier/README.md +5 -6
- package/lib/remove-newline-after-default-import/README.md +4 -4
- package/lib/tape-add-newline-before-assertion/README.md +5 -8
- package/lib/tape-add-newline-between-tests/README.md +5 -8
- package/lib/tape-remove-newline-before-t-end/README.md +4 -7
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
|
|
13
|
+
npm i putout eslint eslint-plugin-putout -D
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `putout` and `eslint-plugin-putout` globally.
|
|
@@ -52,43 +52,59 @@ Then configure the rules you want to use under the rules section.
|
|
|
52
52
|
"putout/remove-newline-from-empty-object": "error",
|
|
53
53
|
"putout/remove-empty-newline-before-first-specifier": "error",
|
|
54
54
|
"putout/remove-empty-newline-after-last-specifier": "error",
|
|
55
|
+
"putout/remove-empty-newline-after-last-element": "error",
|
|
55
56
|
"putout/remove-empty-newline-after-import": "error",
|
|
56
57
|
"putout/remove-empty-specifiers": "error",
|
|
57
58
|
"putout/objects-braces-inside-array": "error",
|
|
58
|
-
"putout/object-init": "error"
|
|
59
|
+
"putout/object-init": "error",
|
|
60
|
+
"putout/tape-add-newline-between-tests": "error",
|
|
61
|
+
"putout/tape-add-newline-before-assertion": "error",
|
|
62
|
+
"putout/tape-remove-newline-before-t-end": "error"
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
```
|
|
62
66
|
|
|
63
67
|
## Rules
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- [
|
|
68
|
-
- [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- [
|
|
73
|
-
- [
|
|
74
|
-
- [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- [
|
|
83
|
-
- [
|
|
84
|
-
- [
|
|
85
|
-
- [
|
|
86
|
-
- [
|
|
87
|
-
- [
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
69
|
+
### 🐊 [Putout](https://github.com/coderaiser/putout#readme)
|
|
70
|
+
|
|
71
|
+
- ✅ [Putout](/packages/eslint-plugin-putout/lib/putout#readme)
|
|
72
|
+
- ✅ [Evaluate](/packages/eslint-plugin-putout/lib/evaluate#readme)
|
|
73
|
+
|
|
74
|
+
### 📼 [Supertape](https://github.com/coderaiser/supertape#readme)
|
|
75
|
+
|
|
76
|
+
- ✅ [add newline before assertion](/packages/eslint-plugin-putout/lib/tape-add-newline-before-assertion#readme)
|
|
77
|
+
- ✅ [add newline between tests](/packages/eslint-plugin-putout/lib/tape-add-newline-between-tests#readme)
|
|
78
|
+
- ✅ [remove newline before t.end()](/packages/eslint-plugin-putout/lib/tape-remove-newline-before-t-end#readme)
|
|
79
|
+
|
|
80
|
+
### TypeScript
|
|
81
|
+
|
|
82
|
+
- ✅ [Add newlines between types in union](/packages/eslint-plugin-putout/lib/add-newlines-between-types-in-union#readme)
|
|
83
|
+
|
|
84
|
+
### Formatting
|
|
85
|
+
|
|
86
|
+
- ✅ [Add newline before function call](/packages/eslint-plugin-putout/lib/add-newline-before-function-call#readme)
|
|
87
|
+
- ✅ [Add newline after function call](/packages/eslint-plugin-putout/lib/add-newline-after-function-call#readme)
|
|
88
|
+
- ✅ [Align spaces](/packages/eslint-plugin-putout/lib/align-spaces#readme)
|
|
89
|
+
- ✅ [Array element newline](/packages/eslint-plugin-putout/lib/array-element-newline#readme)
|
|
90
|
+
- ✅ [Single property destructuring](/packages/eslint-plugin-putout/lib/single-property-destructuring#readme)
|
|
91
|
+
- ✅ [Multiple properties destructuring](/packages/eslint-plugin-putout/lib/multiple-properties-destructuring#readme)
|
|
92
|
+
- ✅ [For-of multiple properties destructuring](/packages/eslint-plugin-putout/lib/for-of-multiple-properties-destructuring#readme)
|
|
93
|
+
- ✅ [Long properties destructuring](/packages/eslint-plugin-putout/lib/long-properties-destructuring#readme)
|
|
94
|
+
- ✅ [Destructuring as function argument](/packages/eslint-plugin-putout/lib/destructuring-as-function-argument#readme)
|
|
95
|
+
- ✅ [Keyword spacing](/packages/eslint-plugin-putout/lib/keyword-spacing#readme)
|
|
96
|
+
- ✅ [Newline function call arguments](/packages/eslint-plugin-putout/lib/newline-function-call-arguments#readme)
|
|
97
|
+
- ✅ [Function declaration paren newline](/packages/eslint-plugin-putout/lib/function-declaration-paren-newline#readme)
|
|
98
|
+
- ✅ [Remove newline after default import](/packages/eslint-plugin-putout/lib/remove-newline-after-default-import#readme)
|
|
99
|
+
- ✅ [Remove newline from empty object](/packages/eslint-plugin-putout/lib/remove-newline-from-empty-object#readme)
|
|
100
|
+
- ✅ [Remove empty newline before first specifier](/packages/eslint-plugin-putout/lib/remove-empty-newline-before-first-specifier#readme)
|
|
101
|
+
- ✅ [Remove empty newline after last specifier](/packages/eslint-plugin-putout/lib/remove-empty-newline-after-last-specifier#readme)
|
|
102
|
+
- ✅ [Remove empty newline after last element](/packages/eslint-plugin-putout/lib/remove-empty-newline-after-last-element#readme)
|
|
103
|
+
- ✅ [Remove empty newline after import](/packages/eslint-plugin-putout/lib/remove-empty-newline-after-import#readme)
|
|
104
|
+
- ✅ [Remove empty specifiers](/packages/eslint-plugin-putout/lib/remove-empty-specifiers#readme)
|
|
105
|
+
- ✅ [Objects braces inside array](/packages/eslint-plugin-putout/lib/objects-braces-inside-array#readme)
|
|
106
|
+
- ✅ [Object init](/packages/eslint-plugin-putout/lib/object-init#readme)
|
|
107
|
+
- ✅ [No unresolved](/packages/eslint-plugin-putout/lib/no-unresolved#readme)
|
|
92
108
|
|
|
93
109
|
### Safe mode
|
|
94
110
|
|
|
@@ -108,27 +124,28 @@ When using 🐊`Putout` in IDE with `--fix` on save, or when you want to disable
|
|
|
108
124
|
Disabled `ESLint` rules:
|
|
109
125
|
|
|
110
126
|
- [`no-useless-return`](https://eslint.org/docs/rules/no-useless-return#readme)
|
|
111
|
-
- [`putout/remove-newline-from-empty-object`](https://
|
|
127
|
+
- [`putout/remove-newline-from-empty-object`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout/lib/remove-newline-from-empty-object#readme)
|
|
112
128
|
|
|
113
129
|
Disabled 🐊`Putout` rules:
|
|
114
130
|
|
|
115
|
-
- [`remove-empty`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-empty#readme);
|
|
116
|
-
- [`nodejs/remove-process-exit`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-nodejs#remove-process-exit#readme);
|
|
117
|
-
- [`remove-unused-variables`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/remove-unused-variables#readme);
|
|
118
|
-
- [`typescript/remove-unused-types`](https://github.com/coderaiser/putout/tree/v24.0.2/packages/plugin-typescript#remove-unused-types#readme);
|
|
119
|
-
- [`remove-unused-for-of-variables`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/remove-unused-for-of-variables#readme);
|
|
120
|
-
- [`remove-unused-expressions`](https://github.com/coderaiser/putout/tree/v24.0.0/packages#readme);
|
|
121
|
-
- [`remove-unreferenced-variables`](https://github.com/coderaiser/putout/tree/24.1.0/packages#readme);
|
|
122
|
-
- [`remove-useless-
|
|
123
|
-
- [`remove-useless-
|
|
124
|
-
- [`remove-useless-
|
|
125
|
-
- [`remove-useless-
|
|
126
|
-
- [`remove-
|
|
127
|
-
- [`remove-
|
|
128
|
-
- [`remove-
|
|
129
|
-
- [`remove-
|
|
130
|
-
- [`remove-
|
|
131
|
-
- [`
|
|
131
|
+
- 🐲[`remove-empty`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-empty#readme);
|
|
132
|
+
- 🐲[`nodejs/remove-process-exit`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-nodejs#remove-process-exit#readme);
|
|
133
|
+
- 🐲[`remove-unused-variables`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-unused-variables#readme);
|
|
134
|
+
- 🐲[`typescript/remove-unused-types`](https://github.com/coderaiser/putout/tree/v24.0.2/packages/plugin-typescript#remove-unused-types#readme);
|
|
135
|
+
- 🐲[`remove-unused-for-of-variables`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-unused-for-of-variables#readme);
|
|
136
|
+
- 🐲[`remove-unused-expressions`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-removeunused-expressions#readme);
|
|
137
|
+
- 🐲[`remove-unreferenced-variables`](https://github.com/coderaiser/putout/tree/24.1.0/packages/plugin-remove-unreferenced-variables#readme);
|
|
138
|
+
- 🐲[`remove-useless-arguments`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-arguments#readme);
|
|
139
|
+
- 🐲[`remove-useless-for-of`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-for-of#readme);
|
|
140
|
+
- 🐲[`remove-useless-return`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-return#readme);
|
|
141
|
+
- 🐲[`remove-useless-spread`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-spread/#readme#readme);
|
|
142
|
+
- 🐲[`remove-useless-variables/rename`](https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-arguments#rename#readme);
|
|
143
|
+
- 🐲[`remove-skip`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-tape#remove-skip);
|
|
144
|
+
- 🐲[`remove-only`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-tape#remove-only);
|
|
145
|
+
- 🐲[`remove-console`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-console#readme);
|
|
146
|
+
- 🐲[`remove-debugger`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-debugger#readme);
|
|
147
|
+
- 🐲[`remove-unreachable-code`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-remove-unreachable-code#readme);
|
|
148
|
+
- 🐲[`convert-for-to-for-of`](https://github.com/coderaiser/putout/tree/v24.0.0/packages/plugin-convert-for-to-for-of#readme);
|
|
132
149
|
|
|
133
150
|
### safe+align
|
|
134
151
|
|
package/lib/evaluate/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Evaluate
|
|
2
2
|
|
|
3
|
-
Evaluate expression started with `__putout_evaluate: `.
|
|
4
|
-
|
|
3
|
+
Evaluate expression started with `__putout_evaluate: `. Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules)
|
|
4
|
+
|
|
5
|
+
Provided code is processed with [`@putout/plugin-declare-undefined-variables`](https://github.com/coderaiser/putout/tree/master/packages/plugin-declare-undefined-variables):
|
|
5
6
|
|
|
6
7
|
```js
|
|
7
|
-
import {join} from 'path';
|
|
8
8
|
__putout_evaluate: join("hello", " ", "world");
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
and converted to:
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
14
|
const fn = (__filename, __dirname, require) => {
|
|
@@ -17,18 +17,16 @@ const fn = (__filename, __dirname, require) => {
|
|
|
17
17
|
};
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
This rule aims to evaluate expressions `source` of `ImportDeclaration`:
|
|
20
|
+
When you want to evaluate expressions `source` of `ImportDeclaration`:
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
## ❌ Example of incorrect code
|
|
25
23
|
|
|
26
24
|
```js
|
|
27
25
|
import {readFile} from '__putout_evaluate: `./` + basename(__filename).replace(`.spec.js`, `.js`)';
|
|
28
26
|
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
## ✅ Example of correct code
|
|
32
30
|
|
|
33
31
|
```js
|
|
34
32
|
import {readFile} from './hello.js';
|
package/lib/evaluate/index.js
CHANGED
|
@@ -30,15 +30,17 @@ module.exports.fix = ({text, node, filename}) => {
|
|
|
30
30
|
function evaluate({value, filename}) {
|
|
31
31
|
value = value.replace(/__putout_evaluate:\s?/, 'return ');
|
|
32
32
|
const {code} = putout(value, {
|
|
33
|
+
fix: true,
|
|
33
34
|
rules: {
|
|
34
|
-
'convert-
|
|
35
|
+
'nodejs/convert-top-level-return': 'off',
|
|
35
36
|
},
|
|
36
37
|
plugins: [
|
|
37
|
-
'
|
|
38
|
+
'nodejs',
|
|
38
39
|
'convert-esm-to-commonjs',
|
|
40
|
+
'declare-undefined-variables',
|
|
39
41
|
],
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
const fn = Function('__filename', '__dirname', 'require', code);
|
|
43
|
-
return fn(filename, dirname(
|
|
45
|
+
return fn(filename, dirname(filename), require);
|
|
44
46
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# function-declaration-paren-newline
|
|
2
2
|
|
|
3
3
|
Remove newlines between parens in function declaration. Similar to `ESLint` rule [function-paren-newline](https://eslint.org/docs/rules/function-declaration-paren-newline), but forbids new lines in function declarations and expressions arguments.
|
|
4
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
4
5
|
|
|
5
|
-
## ❌
|
|
6
|
+
## ❌ Example of incorrect code
|
|
6
7
|
|
|
7
8
|
```js
|
|
8
9
|
function f(
|
|
@@ -22,7 +23,7 @@ regexpTree.traverse(ast, {
|
|
|
22
23
|
});
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
## ✅
|
|
26
|
+
## ✅ Example of correct code
|
|
26
27
|
|
|
27
28
|
```js
|
|
28
29
|
function f({a, b, c}) {}
|
package/lib/index.js
CHANGED
|
@@ -33,6 +33,7 @@ module.exports.rules = {
|
|
|
33
33
|
...getWrapRule('remove-newline-from-empty-object'),
|
|
34
34
|
...getWrapRule('remove-empty-newline-before-first-specifier'),
|
|
35
35
|
...getWrapRule('remove-empty-newline-after-last-specifier'),
|
|
36
|
+
...getWrapRule('remove-empty-newline-after-last-element'),
|
|
36
37
|
...getWrapRule('remove-empty-specifiers'),
|
|
37
38
|
...getWrapRule('objects-braces-inside-array'),
|
|
38
39
|
...getWrapRule('object-init'),
|
|
@@ -72,6 +73,7 @@ const recommended = {
|
|
|
72
73
|
'putout/remove-newline-from-empty-object': 'error',
|
|
73
74
|
'putout/remove-empty-newline-before-first-specifier': 'error',
|
|
74
75
|
'putout/remove-empty-newline-after-last-specifier': 'error',
|
|
76
|
+
'putout/remove-empty-newline-after-last-element': 'error',
|
|
75
77
|
'putout/remove-empty-newline-after-import': 'error',
|
|
76
78
|
'putout/remove-empty-specifiers': 'error',
|
|
77
79
|
'putout/objects-braces-inside-array': 'error',
|
|
@@ -113,9 +115,10 @@ const safe = {
|
|
|
113
115
|
'remove-unused-expressions': 'off',
|
|
114
116
|
'remove-unused-for-of-variables': 'off',
|
|
115
117
|
'remove-unreachable-code': 'off',
|
|
116
|
-
'remove-useless-
|
|
118
|
+
'remove-useless-for-of': 'off',
|
|
117
119
|
'remove-useless-arguments': 'off',
|
|
118
120
|
'remove-useless-variables/rename': 'off',
|
|
121
|
+
'remove-useless-return': 'off',
|
|
119
122
|
'remove-useless-spread': 'off',
|
|
120
123
|
'remove-unreferenced-variables': 'off',
|
|
121
124
|
'tape/remove-skip': 'off',
|
package/lib/putout/README.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# Putout (`putout`)
|
|
2
2
|
|
|
3
|
-
🐊[`Putout`](https://github.com/coderaiser/putout) used as eslint plugin.
|
|
4
|
-
|
|
5
|
-
## Rule Details
|
|
6
|
-
|
|
7
|
-
Rules run [putout rules](https://github.com/coderaiser/putout#built-in-transforms) in `eslint`.
|
|
3
|
+
🐊[`Putout`](https://github.com/coderaiser/putout) used as eslint plugin runs [putout rules](https://github.com/coderaiser/putout#built-in-transforms) in `eslint`.
|
|
8
4
|
|
|
9
5
|
And can be [configured](https://eslint.org/docs/user-guide/configuring#configuring-rules) according to [putout configuration](https://github.com/coderaiser/putout#configuration).
|
|
10
6
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# remove-empty-newline-after-last-element
|
|
2
|
+
|
|
3
|
+
Remove empty newline after last element.
|
|
4
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
5
|
+
|
|
6
|
+
## ❌ Example of incorrect code
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
push([
|
|
10
|
+
a,
|
|
11
|
+
b,
|
|
12
|
+
|
|
13
|
+
]);
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## ✅ Example of correct code
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
push([
|
|
20
|
+
a,
|
|
21
|
+
b,
|
|
22
|
+
]);
|
|
23
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports.category = 'array';
|
|
4
|
+
module.exports.report = () => 'Remove newline after last element';
|
|
5
|
+
|
|
6
|
+
const regExp = /\n\n(\s+)?]/;
|
|
7
|
+
|
|
8
|
+
module.exports.filter = ({text}) => {
|
|
9
|
+
return regExp.test(text);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
module.exports.fix = ({text}) => {
|
|
13
|
+
return text
|
|
14
|
+
.replace(regExp, '\n]');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
module.exports.include = () => [
|
|
18
|
+
'ArrayExpression',
|
|
19
|
+
];
|
|
20
|
+
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# remove-empty-newline-after-last-specifier
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Remove empty newline after last specifier.
|
|
4
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Examples of **incorrect** code for this rule:
|
|
6
|
+
## ❌ Example of incorrect code
|
|
8
7
|
|
|
9
8
|
```js
|
|
10
9
|
import {
|
|
@@ -20,7 +19,7 @@ push({
|
|
|
20
19
|
});
|
|
21
20
|
```
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
## ✅ Example of correct code
|
|
24
23
|
|
|
25
24
|
```js
|
|
26
25
|
import {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# remove-newline-after-default-import
|
|
2
2
|
|
|
3
|
-
Fixes [`object-curly-newline`](https://eslint.org/docs/rules/object-curly-newline) + [`eslint-plugin-modules-newline`](https://github.com/gmsorrow/eslint-plugin-modules-newline).
|
|
4
|
-
|
|
5
3
|
This rule aims to remove newline after default import, before opening curly brace (`{`).
|
|
4
|
+
Fixes [`object-curly-newline`](https://eslint.org/docs/rules/object-curly-newline) + [`eslint-plugin-modules-newline`](https://github.com/gmsorrow/eslint-plugin-modules-newline).
|
|
5
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
6
6
|
|
|
7
|
-
## ❌
|
|
7
|
+
## ❌ Example of incorrect code
|
|
8
8
|
|
|
9
9
|
```js
|
|
10
10
|
import x,
|
|
@@ -14,7 +14,7 @@ import x,
|
|
|
14
14
|
} from 'y';
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
## ✅
|
|
17
|
+
## ✅ Example of correct code
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
20
|
import x, {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# add-newline-before-assertion
|
|
2
2
|
|
|
3
|
-
Add newline before `t.equal()` etc, for [`
|
|
3
|
+
Add newline before `t.equal()` etc, for 📼[`Supertape`](https://github.com/coderaiser/supertape).
|
|
4
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
This rule aims to add newline before assertion.
|
|
8
|
-
|
|
9
|
-
Examples of **incorrect** code for this rule:
|
|
6
|
+
## ❌ Example of incorrect code
|
|
10
7
|
|
|
11
8
|
```js
|
|
12
9
|
test('lint: do some check', (t) => {
|
|
@@ -18,7 +15,7 @@ test('lint: do some check', (t) => {
|
|
|
18
15
|
});
|
|
19
16
|
```
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
## ✅ Example of correct code
|
|
22
19
|
|
|
23
20
|
```js
|
|
24
21
|
test('lint: do some check', (t) => {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# add-newline-between-tests
|
|
2
2
|
|
|
3
|
-
Add newline between tests, for [`
|
|
3
|
+
Add newline between tests, for 📼[`Supertape`](https://github.com/coderaiser/supertape).
|
|
4
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
This rule aims to add newline between tests.
|
|
8
|
-
|
|
9
|
-
Examples of **incorrect** code for this rule:
|
|
6
|
+
## ❌ Example of incorrect code
|
|
10
7
|
|
|
11
8
|
```js
|
|
12
9
|
test('lint: do some check', (t) => {
|
|
@@ -23,7 +20,7 @@ test('lint: do some check', (t) => {
|
|
|
23
20
|
});
|
|
24
21
|
```
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
## ✅ Example of correct code
|
|
27
24
|
|
|
28
25
|
```js
|
|
29
26
|
test('lint: do some check', (t) => {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# remove-newline-before-t-end
|
|
2
2
|
|
|
3
3
|
Remove newline before `t.end()`, for [`supertape`](https://github.com/coderaiser/supertape).
|
|
4
|
+
Part of [`eslint-plugin-putout`](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout#rules).
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
This rule aims to remove newline before `t.end()`.
|
|
8
|
-
|
|
9
|
-
Examples of **incorrect** code for this rule:
|
|
6
|
+
## ❌ Example of incorrect code
|
|
10
7
|
|
|
11
8
|
```js
|
|
12
9
|
test('lint: do some check', (t) => {
|
|
@@ -18,7 +15,7 @@ test('lint: do some check', (t) => {
|
|
|
18
15
|
});
|
|
19
16
|
```
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
## ✅ Example of correct code
|
|
22
19
|
|
|
23
20
|
```js
|
|
24
21
|
test('lint: do some check', (t) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "eslint plugin for putout",
|
|
6
6
|
"release": false,
|
|
@@ -49,23 +49,23 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/plugin-syntax-typescript": "^7.12.1",
|
|
52
|
-
"@putout/test": "^
|
|
52
|
+
"@putout/test": "^5.0.0",
|
|
53
53
|
"c8": "^7.5.0",
|
|
54
54
|
"eslint": "^8.0.1",
|
|
55
55
|
"eslint-plugin-eslint-plugin": "^3.2.0",
|
|
56
|
-
"madrun": "^
|
|
56
|
+
"madrun": "^9.0.0",
|
|
57
57
|
"mocha": "^9.0.1",
|
|
58
58
|
"montag": "^1.0.0",
|
|
59
59
|
"simport": "^1.2.0",
|
|
60
|
-
"supertape": "^
|
|
60
|
+
"supertape": "^7.0.0",
|
|
61
61
|
"try-to-catch": "^3.0.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
|
-
"node": ">=
|
|
64
|
+
"node": ">=16"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"eslint": ">=8.0.0",
|
|
68
|
-
"putout": ">=
|
|
68
|
+
"putout": ">=25"
|
|
69
69
|
},
|
|
70
70
|
"license": "MIT",
|
|
71
71
|
"publishConfig": {
|