@putout/plugin-putout 22.7.0 → 22.9.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.
@@ -37,6 +37,10 @@ const isTest = (path) => compare(path, 'test(__a, (t) => __body)', {
37
37
  findUp: false,
38
38
  });
39
39
 
40
+ const isTestOnly = (path) => compare(path, 'test.only(__a, (t) => __body)', {
41
+ findUp: false,
42
+ });
43
+
40
44
  const check = ({__a}, path) => {
41
45
  const name = __a.value;
42
46
 
@@ -74,6 +78,9 @@ const transform = ({__a}, path) => {
74
78
  const getTestNodeArgument = (path) => {
75
79
  let testPath = path.find(isTest);
76
80
 
81
+ if (!testPath)
82
+ testPath = path.find(isTestOnly);
83
+
77
84
  if (!testPath)
78
85
  return {
79
86
  value: '',
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const {types} = require('putout');
3
+ const {types, operator} = require('putout');
4
+ const {getBindingPath} = operator;
4
5
  const {
5
6
  ObjectPattern,
6
7
  isIdentifier,
@@ -28,7 +29,7 @@ module.exports.fix = ({path, node}) => {
28
29
  };
29
30
 
30
31
  module.exports.traverse = ({push}) => ({
31
- '(vars, path) => __body': (path) => {
32
+ '(__a, path) => __body': (path) => {
32
33
  path.traverse({
33
34
  ReferencedIdentifier(refPath) {
34
35
  const {node} = refPath;
@@ -37,7 +38,7 @@ module.exports.traverse = ({push}) => ({
37
38
  if (!name.startsWith('__'))
38
39
  return;
39
40
 
40
- if (refPath.scope.bindings[name])
41
+ if (getBindingPath(refPath, name))
41
42
  return;
42
43
 
43
44
  push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "22.7.0",
3
+ "version": "22.9.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",