@putout/plugin-putout 8.1.0 → 8.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
@@ -19,6 +19,7 @@ npm i @putout/plugin-putout -D
19
19
  "putout/apply-processors-destructuring": "on",
20
20
  "putout/apply-async-formatter": "on",
21
21
  "putout/add-args": "on",
22
+ "putout/convert-putout-test-to-create-test": "on",
22
23
  "putout/convert-to-no-transform-code": "on",
23
24
  "putout/convert-replace-with": "on",
24
25
  "putout/convert-replace-with-multiple": "on",
@@ -74,6 +75,19 @@ test('formatter: codeframea', async ({format}) => {
74
75
  await format(codeframe, 1);
75
76
  });
76
77
  ```
78
+ ## convert-putout-test-to-create-test"
79
+
80
+ ### ❌ Incorrect code example
81
+
82
+ ```js
83
+ import putoutTest from '@putout/test';
84
+ ```
85
+
86
+ ### ✅ Correct code Example
87
+
88
+ ```js
89
+ import createTest from '@putout/test';
90
+ ```
77
91
 
78
92
  ## convert-to-no-transform-code
79
93
 
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ module.exports.report = () => `Use 'createTest' instead of 'putoutTest'`;
4
+
5
+ module.exports.replace = () => ({
6
+ 'import putoutTest from "@putout/test"': (vars, path) => {
7
+ path.scope.rename('putoutTest', 'createTest');
8
+ return path;
9
+ },
10
+ });
11
+
package/lib/index.js CHANGED
@@ -7,6 +7,7 @@ const getRule = (a) => ({
7
7
  module.exports.rules = {
8
8
  ...getRule('apply-processors-destructuring'),
9
9
  ...getRule('apply-async-formatter'),
10
+ ...getRule('convert-putout-test-to-create-test'),
10
11
  ...getRule('convert-to-no-transform-code'),
11
12
  ...getRule('convert-find-to-traverse'),
12
13
  ...getRule('convert-replace-with'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "putout plugin helps with plugins development",
6
6
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-putout",