@putout/plugin-putout 29.3.0 → 29.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.
package/README.md CHANGED
@@ -40,6 +40,7 @@ npm i @putout/plugin-putout -D
40
40
  - ✅ [apply-insert-before](#apply-insert-before);
41
41
  - ✅ [apply-traverser-to-ignore](#apply-traverser-to-ignore);
42
42
  - ✅ [apply-vars](#apply-vars);
43
+ - ✅ [apply-name-to-is-identifier](#apply-name-to-is-identifier);
43
44
  - ✅ [apply-lowercase-to-node-builders](#apply-lowercase-to-node-builders);
44
45
  - ✅ [apply-namespace-specifier](#apply-namespace-specifier);
45
46
  - ✅ [apply-report](#apply-report);
@@ -133,6 +134,7 @@ npm i @putout/plugin-putout -D
133
134
  "putout/apply-traverser-to-ignore": "on",
134
135
  "putout/apply-insert-after": "on",
135
136
  "putout/apply-vars": "on",
137
+ "putout/apply-name-to-is-identifier": "on",
136
138
  "putout/apply-short-processors": "on",
137
139
  "putout/apply-lowercase-to-node-builders": "on",
138
140
  "putout/apply-namespace-specifier": "on",
@@ -522,6 +524,24 @@ export const match = () => ({
522
524
  });
523
525
  ```
524
526
 
527
+ ## apply-name-to-is-identifier
528
+
529
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/9d416e21377a53ef13066007f7037bdf/e179718fe1908851c26f10ba84fab1bf7ebca3ce).
530
+
531
+ ### ❌ Example of incorrect code
532
+
533
+ ```js
534
+ isIdentifier(path, 'hello');
535
+ ```
536
+
537
+ ### ✅ Example of correct code
538
+
539
+ ```js
540
+ isIdentifier(path, {
541
+ name: 'hello',
542
+ });
543
+ ```
544
+
525
545
  ## apply-declare
526
546
 
527
547
  Better to use [`Declareator`](https://github.com/coderaiser/putout/tree/master/packages/engine-runner#declarator) instead of `operator.declare()`.
@@ -0,0 +1,8 @@
1
+ export const report = (path) => {
2
+ const {value} = path.get('arguments.1').node;
3
+ return `Use \`{name: '${value}'}\` instead of '${value}'`;
4
+ };
5
+
6
+ export const replace = () => ({
7
+ 'isIdentifier(__a, "__b")': 'isIdentifier(__a, {name: "__b"})',
8
+ });
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import * as addPathToFilter from './add-path-to-filter/index.js';
1
+ import * as applyNameToIsIdentifier from './apply-name-to-is-identifier/index.js';
2
+ import * as addPathArgToFilter from './add-path-arg-to-filter/index.js';
2
3
  import * as removeUselessSourceArgument from './remove-useless-source-argument/index.js';
3
4
  import * as applyTraverserToIgnore from './apply-traverser-to-ignore/index.js';
4
5
  import * as addPathArgToMatch from './add-path-arg-to-match/index.js';
@@ -165,5 +166,6 @@ export const rules = {
165
166
  'add-path-arg-to-match': addPathArgToMatch,
166
167
  'apply-traverser-to-ignore': applyTraverserToIgnore,
167
168
  'remove-useless-source-argument': removeUselessSourceArgument,
168
- 'add-path-to-filter': addPathToFilter,
169
+ 'add-path-arg-to-filter': addPathArgToFilter,
170
+ 'apply-name-to-is-identifier': applyNameToIsIdentifier,
169
171
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "29.3.0",
3
+ "version": "29.4.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",