@putout/plugin-putout 21.0.0 → 21.2.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
@@ -16,6 +16,7 @@ npm i @putout/plugin-putout -D
16
16
  - ✅ [add-await-to-progress](#add-await-to-progress);
17
17
  - ✅ [add-index-to-import](#add-index-to-import);
18
18
  - ✅ [add-places-to-compare-places](#add-places-to-compare-places);
19
+ - ✅ [add-path-arg-to-fix](#add-path-arg-to-fix);
19
20
  - ✅ [add-test-args](#add-test-args);
20
21
  - ✅ [add-traverse-args](#add-traverse-args);
21
22
  - ✅ [add-track-file](#add-track-file);
@@ -71,6 +72,13 @@ npm i @putout/plugin-putout -D
71
72
  ```json
72
73
  {
73
74
  "rules": {
75
+ "putout/add-places-to-compare-places": "on",
76
+ "putout/add-path-arg-to-fix": "on",
77
+ "putout/add-test-args": "on",
78
+ "putout/add-traverse-args": "on",
79
+ "putout/add-track-file": "on",
80
+ "putout/add-await-to-progress": "on",
81
+ "putout/add-index-to-import": "on",
74
82
  "putout/apply-create-test": "on",
75
83
  "putout/apply-processors-destructuring": "on",
76
84
  "putout/apply-async-formatter": "on",
@@ -82,12 +90,6 @@ npm i @putout/plugin-putout -D
82
90
  "putout/apply-short-processors": "on",
83
91
  "putout/apply-namespace-specifier": "on",
84
92
  "putout/apply-for-of-to-track-file": "on",
85
- "putout/add-places-to-compare-places": "on",
86
- "putout/add-test-args": "on",
87
- "putout/add-traverse-args": "on",
88
- "putout/add-track-file": "on",
89
- "putout/add-await-to-progress": "on",
90
- "putout/add-index-to-import": "on",
91
93
  "putout/check-match": "on",
92
94
  "putout/check-replace-code": ["on", {
93
95
  "once": true
@@ -820,6 +822,26 @@ comparePlaces('hello');
820
822
  comparePlaces('hello', []);
821
823
  ```
822
824
 
825
+ ## add-path-arg-to-fix
826
+
827
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/3d3fb6b8f5e5376cdd1674c9b19e0e27/4872f77e680a2fc443618f4bf5fae3ffab11046a).
828
+
829
+ ### ❌ Example of incorrect code
830
+
831
+ ```js
832
+ export const fix = () => {
833
+ path.remove();
834
+ };
835
+ ```
836
+
837
+ ### ✅ Example of correct code
838
+
839
+ ```js
840
+ export const fix = (path) => {
841
+ path.remove();
842
+ };
843
+ ```
844
+
823
845
  ## add-test-args
824
846
 
825
847
  ### ❌ Example of incorrect code
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ module.exports.report = () => `Add 'path' argument to 'fix'`;
4
+
5
+ module.exports.replace = () => ({
6
+ 'const fix = () => __a': 'const fix = (path) => __a',
7
+ 'module.exports.fix = () => __body': 'module.exports.fix = (path) => __body',
8
+ });
package/lib/index.js CHANGED
@@ -52,6 +52,7 @@ const removeUnusedGetPropertiesArgument = require('./remove-unused-get-propertie
52
52
  const simplifyReplaceTemplate = require('./simplify-replace-template');
53
53
  const removeEmptyArrayFromProcess = require('./remove-empty-array-from-process');
54
54
  const addPlacesToComparePlaces = require('./add-places-to-compare-places');
55
+ const addPathArgToFix = require('./add-path-arg-to-fix');
55
56
 
56
57
  module.exports.rules = {
57
58
  'apply-processors-destructuring': applyProcessorsDestructuring,
@@ -106,4 +107,5 @@ module.exports.rules = {
106
107
  'simplify-replace-template': simplifyReplaceTemplate,
107
108
  'remove-empty-array-from-process': removeEmptyArrayFromProcess,
108
109
  'add-places-to-compare-places': addPlacesToComparePlaces,
110
+ 'add-path-arg-to-fix': addPathArgToFix,
109
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "21.0.0",
3
+ "version": "21.2.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",
@@ -11,7 +11,7 @@
11
11
  "changelog": false,
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git://github.com/coderaiser/putout.git"
14
+ "url": "git+https://github.com/coderaiser/putout.git"
15
15
  },
16
16
  "scripts": {
17
17
  "wisdom": "madrun wisdom",
@@ -37,6 +37,7 @@
37
37
  "putout"
38
38
  ],
39
39
  "devDependencies": {
40
+ "@putout/plugin-nodejs": "*",
40
41
  "@putout/plugin-tape": "*",
41
42
  "@putout/test": "^11.0.0",
42
43
  "c8": "^10.0.0",