@putout/plugin-putout 29.12.0 → 29.14.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.
@@ -40,6 +40,8 @@ export const match = () => ({
40
40
  't.noTransformWithOptions(__a, __b)': check,
41
41
  't.noTransform(__a)': check,
42
42
  't.noReportWithOptions(__a, __b)': check,
43
+ 'transform(__a)': check,
44
+ 'noReportAfterTransform(__a)': check,
43
45
  });
44
46
 
45
47
  export const replace = () => ({
@@ -54,12 +56,18 @@ export const replace = () => ({
54
56
  't.noTransform(__a)': transform,
55
57
  't.noReportAfterTransform(__a)': transform,
56
58
  't.noReportWithOptions(__a, __b)': transform,
59
+ 'transform(__a)': transform,
60
+ 'noReportAfterTransform(__a)': transform,
57
61
  });
58
62
 
59
63
  const isTest = (path) => compare(path, 'test(__a, (t) => __body)', {
60
64
  findUp: false,
61
65
  });
62
66
 
67
+ const isTestDestructuring = (path) => compare(path, 'test(__a, ({__b}) => __body)', {
68
+ findUp: false,
69
+ });
70
+
63
71
  const isTestOnly = (path) => compare(path, 'test.only(__a, (t) => __body)', {
64
72
  findUp: false,
65
73
  });
@@ -112,6 +120,9 @@ const getTestNodeArgument = (path) => {
112
120
  if (!testPath)
113
121
  testPath = path.find(isTestOnly);
114
122
 
123
+ if (!testPath)
124
+ testPath = path.find(isTestDestructuring);
125
+
115
126
  if (!testPath)
116
127
  return {
117
128
  value: '',
@@ -114,6 +114,9 @@ const createTraverseReplacer = ({once, push}) => (path) => {
114
114
  isTS: true,
115
115
  });
116
116
 
117
+ if (!ast.program.body.length)
118
+ return;
119
+
117
120
  const [transformError] = tryCatch(transform, ast, {
118
121
  plugins: [
119
122
  ['evaluate', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "29.12.0",
3
+ "version": "29.14.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",