@putout/plugin-tape 21.15.0 → 21.16.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/lib/remove-skip/index.js
CHANGED
|
@@ -6,12 +6,17 @@ const {isIdentifier} = types;
|
|
|
6
6
|
|
|
7
7
|
export const report = () => 'Remove "test.skip"';
|
|
8
8
|
|
|
9
|
+
export const match = ({options}) => ({
|
|
10
|
+
'__a.skip(__b, __c)': check(options),
|
|
11
|
+
'__a.skip(__b, __c, __d)': check(options),
|
|
12
|
+
});
|
|
13
|
+
|
|
9
14
|
export const replace = () => ({
|
|
10
15
|
'__a.skip(__b, __c)': '__a(__b, __c)',
|
|
11
16
|
'__a.skip(__b, __c, __d)': '__a(__b, __c, __d)',
|
|
12
17
|
});
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
const check = (options) => ({__a}) => {
|
|
15
20
|
const {allowed = []} = options;
|
|
16
21
|
const all = [
|
|
17
22
|
'test',
|
|
@@ -19,7 +24,7 @@ export const filter = (path, {options}) => {
|
|
|
19
24
|
];
|
|
20
25
|
|
|
21
26
|
for (const name of all) {
|
|
22
|
-
const is = isIdentifier(
|
|
27
|
+
const is = isIdentifier(__a, {
|
|
23
28
|
name,
|
|
24
29
|
});
|
|
25
30
|
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import {types, operator} from 'putout';
|
|
2
2
|
|
|
3
3
|
const {remove} = operator;
|
|
4
|
-
const {
|
|
4
|
+
const {
|
|
5
|
+
objectProperty,
|
|
6
|
+
objectPattern,
|
|
7
|
+
isReturnStatement,
|
|
8
|
+
} = types;
|
|
5
9
|
|
|
6
|
-
export const report = () => `
|
|
10
|
+
export const report = () => `Avoid 't' in async`;
|
|
11
|
+
|
|
12
|
+
export const match = () => ({
|
|
13
|
+
'await t.__a(__args)': (vars, path) => {
|
|
14
|
+
const {parentPath} = path;
|
|
15
|
+
|
|
16
|
+
return !isReturnStatement(parentPath);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
7
19
|
|
|
8
20
|
export const replace = () => ({
|
|
9
21
|
'await t.__a(__args)': ({__a}, path) => {
|
|
10
|
-
const
|
|
22
|
+
const {parentPath} = path;
|
|
23
|
+
const next = parentPath.getNextSibling();
|
|
11
24
|
|
|
12
25
|
path.scope.block.params = [
|
|
13
26
|
objectPattern([
|
package/package.json
CHANGED