@putout/plugin-putout 28.16.0 → 28.18.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
@@ -17,6 +17,7 @@ npm i @putout/plugin-putout -D
17
17
  - ✅ [add-places-to-compare-places](#add-places-to-compare-places);
18
18
  - ✅ [add-path-arg-to-fix](#add-path-arg-to-fix);
19
19
  - ✅ [add-path-arg-to-visitors](#add-path-arg-to-visitors);
20
+ - ✅ [add-path-arg-to-match](#add-path-arg-to-match);
20
21
  - ✅ [add-push-arg](#add-push-arg);
21
22
  - ✅ [add-test-args](#add-test-args);
22
23
  - ✅ [add-traverse-args](#add-traverse-args);
@@ -86,6 +87,7 @@ npm i @putout/plugin-putout -D
86
87
  - ✅ [remove-empty-object-from-transform](#remove-empty-object-from-transform);
87
88
  - ✅ [remove-unused-get-properties-argument](#remove-unused-get-properties-argument);
88
89
  - ✅ [remove-useless-printer-option](#remove-useless-printer-option);
90
+ - ✅ [remove-message-from-no-report-after-transform](#remove-message-from-no-report-after-transform);
89
91
  - ✅ [rename-operate-to-operator](#rename-operate-to-operator);
90
92
  - ✅ [replace-operate-with-operator](#replace-operate-with-operator);
91
93
  - ✅ [replace-test-message](#replace-test-message);
@@ -99,6 +101,7 @@ npm i @putout/plugin-putout -D
99
101
  "rules": {
100
102
  "putout/add-places-to-compare-places": "on",
101
103
  "putout/add-path-arg-to-fix": "on",
104
+ "putout/add-path-to-match": "on",
102
105
  "putout/add-path-arg-to-visitors": "on",
103
106
  "putout/add-push-arg": "on",
104
107
  "putout/add-test-args": "on",
@@ -173,6 +176,7 @@ npm i @putout/plugin-putout -D
173
176
  "putout/remove-empty-array-from-process": "on",
174
177
  "putout/remove-empty-object-from-transform": "on",
175
178
  "putout/remove-useless-printer-option": "on",
179
+ "putout/remove-message-from-no-report-after-transform": "on",
176
180
  "putout/simplify-replace-template": "on"
177
181
  }
178
182
  }
@@ -1401,6 +1405,36 @@ export const fix = (path) => {
1401
1405
  };
1402
1406
  ```
1403
1407
 
1408
+ ## add-path-arg-to-match
1409
+
1410
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/35189d0e47c6ad1ca369e5a9287a34c1/d5fa7513a44fecc86beabd1faa8542bee7bc3e5e).
1411
+
1412
+ ### ❌ Example of incorrect code
1413
+
1414
+ ```js
1415
+ export const match = () => ({
1416
+ 'nemesis.getChar()': () => {
1417
+ return path.parentPath.isExpressionStatement();
1418
+ },
1419
+ 'getChar()': ({__a}) => {
1420
+ return path.parentPath.isExpressionStatement();
1421
+ },
1422
+ });
1423
+ ```
1424
+
1425
+ ### ✅ Example of correct code
1426
+
1427
+ ```js
1428
+ export const match = () => ({
1429
+ 'nemesis.getChar()': (vars, path) => {
1430
+ return path.parentPath.isExpressionStatement();
1431
+ },
1432
+ 'getChar()': ({__a}, path) => {
1433
+ return path.parentPath.isExpressionStatement();
1434
+ },
1435
+ });
1436
+ ```
1437
+
1404
1438
  ## add-path-arg-to-visitors
1405
1439
 
1406
1440
  Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/e20eb16668b2ebbceca1a03cde859e93/fee08d6dbb6aa4d835adacc8e9de4d994fd34848).
@@ -1963,6 +1997,28 @@ const {
1963
1997
  } = getProperties(__jsonPath, ['parser', 'rules', 'extends']);
1964
1998
  ```
1965
1999
 
2000
+ ## remove-message-from-no-report-after-transform
2001
+
2002
+ Check it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/b40b73049530d6c4e142a4d4b09e29e2/2167f30abebc5713e2db916a2a0152e13722e7b1).
2003
+
2004
+ ### ❌ Example of incorrect code
2005
+
2006
+ ```js
2007
+ test('github: set-message-of-commit-fixes: no report after transform', (t) => {
2008
+ t.noReportAfterTransform('set-message-of-commit-fixes', `Set 'message' of 'Commit fixes'`);
2009
+ t.end();
2010
+ });
2011
+ ```
2012
+
2013
+ ### ✅ Example of correct code
2014
+
2015
+ ```js
2016
+ test('github: set-message-of-commit-fixes: no report after transform', (t) => {
2017
+ t.noReportAfterTransform('set-message-of-commit-fixes');
2018
+ t.end();
2019
+ });
2020
+ ```
2021
+
1966
2022
  ## remove-useless-printer-option
1967
2023
 
1968
2024
  Check it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/f176313cf67fd6d7138470385511319f/5b26aa45db21f250016d228b7bbabbb3c10b582b).
@@ -0,0 +1,14 @@
1
+ import {operator} from 'putout';
2
+
3
+ const {addArgs} = operator;
4
+
5
+ export const {
6
+ report,
7
+ fix,
8
+ traverse,
9
+ } = addArgs({
10
+ path: ['vars, path', [
11
+ '(__a) => __body',
12
+ '() => __body',
13
+ ]],
14
+ });
package/lib/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import * as addPathArgToMatch from './add-path-arg-to-match/index.js';
2
+ import * as removeMessageFromNoReportAfterTransform from './remove-message-from-no-report-after-transform/index.js';
1
3
  import * as addCrawlFile from './add-crawl-file/index.js';
2
4
  import * as applyDesturcturing from './apply-desturcturing/index.js';
3
5
  import * as convertGetFileContentToReadFileContent from './convert-get-file-content-to-read-file-content/index.js';
@@ -156,4 +158,6 @@ export const rules = {
156
158
  'convert-get-file-content-to-read-file-content': convertGetFileContentToReadFileContent,
157
159
  'apply-desturcturing': applyDesturcturing,
158
160
  'add-crawl-file': addCrawlFile,
161
+ 'remove-message-from-no-report-after-transform': removeMessageFromNoReportAfterTransform,
162
+ 'add-path-arg-to-match': addPathArgToMatch,
159
163
  };
@@ -0,0 +1,6 @@
1
+ export const report = () => `Avoid 'message' in 't.noReportAfterTransform()'`;
2
+
3
+ export const replace = () => ({
4
+ 't.noReportAfterTransform("__a", `__b`)': 't.noReportAfterTransform("__a")',
5
+ 't.noReportAfterTransform("__a", "__b")': 't.noReportAfterTransform("__a")',
6
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "28.16.0",
3
+ "version": "28.18.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",
@@ -49,7 +49,7 @@
49
49
  "@putout/plugin-tape": "*",
50
50
  "@putout/test": "^15.0.0",
51
51
  "c8": "^10.0.0",
52
- "eslint": "^10.0.0-alpha.0",
52
+ "eslint": "^10.0.0",
53
53
  "eslint-plugin-n": "^17.0.0",
54
54
  "eslint-plugin-putout": "^30.0.0",
55
55
  "madrun": "^12.0.0",