@putout/plugin-putout 23.3.0 → 23.4.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.
@@ -1,7 +1,23 @@
1
1
  'use strict';
2
2
 
3
- module.exports.report = () => `Use 'var' instead of '{}'`;
3
+ const {operator} = require('putout');
4
+ const {compareAny} = operator;
5
+
6
+ module.exports.report = () => `Use 'vars' instead of '{}'`;
7
+
8
+ module.exports.match = () => ({
9
+ '({}, path) => __a': isInsideReplacer,
10
+ });
4
11
 
5
12
  module.exports.replace = () => ({
6
- '({}, path) => __body': '(vars, path) => __body',
13
+ '({}, path) => __a': '(vars, path) => __a',
7
14
  });
15
+
16
+ const isInsideReplacer = (vars, path) => {
17
+ return compareAny(path, [
18
+ 'module.exports.match = __',
19
+ 'module.exports.replace = __',
20
+ 'export const match = __',
21
+ 'export const replace = __',
22
+ ]);
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "23.3.0",
3
+ "version": "23.4.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",