@putout/plugin-putout 11.7.0 → 11.10.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
@@ -24,6 +24,7 @@ npm i @putout/plugin-putout -D
24
24
  "putout/add-push": "on",
25
25
  "putout/convert-putout-test-to-create-test": "on",
26
26
  "putout/convert-to-no-transform-code": "on",
27
+ "putout/convert-number-to-numeric": "on",
27
28
  "putout/convert-replace-with": "on",
28
29
  "putout/convert-replace-with-multiple": "on",
29
30
  "putout/convert-replace-to-function": "on",
@@ -130,6 +131,22 @@ const test = createTest({
130
131
  });
131
132
  ```
132
133
 
134
+ ## convert-number-to-numeric
135
+
136
+ ### ❌ Example of incorrect code
137
+
138
+ ```js
139
+ const {isNumberLiteral} = types;
140
+ isNumberLiteral(node);
141
+ ```
142
+
143
+ ### ✅ Example of correct code
144
+
145
+ ```js
146
+ const {isNumericLiteral} = types;
147
+ isNumericLiteral(node);
148
+ ```
149
+
133
150
  ## convert-putout-test-to-create-test
134
151
 
135
152
  Fixes results of [@putout/convert-commonjs-to-esm](https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-commonjs-to-esm) work.
@@ -278,7 +295,7 @@ const {
278
295
  } = require('putout').types;
279
296
  ```
280
297
 
281
- ## convert-to-no-transform-code
298
+ ## convert-destructuring-to-identifier
282
299
 
283
300
  ### ❌ Example of incorrect code
284
301
 
@@ -24,6 +24,7 @@ module.exports.fix = ({path, __aPath, init}) => {
24
24
  if (compare(path, GET_TEMPLATE_VALUES_NODE)) {
25
25
  const {__a} = getTemplateValues(path, GET_TEMPLATE_VALUES_NODE);
26
26
  replaceWith(__aPath, __a);
27
+
27
28
  return;
28
29
  }
29
30
 
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ module.exports.report = () => `Use 'isNumericLiteral()' instead of 'isNumberLiteral()'`;
4
+
5
+ module.exports.fix = (path) => {
6
+ path.scope.rename('isNumberLiteral', 'isNumericLiteral');
7
+ };
8
+
9
+ module.exports.traverse = ({push}) => ({
10
+ 'isNumberLiteral(__a)': (path) => {
11
+ push(path);
12
+ },
13
+ });
14
+
@@ -5,9 +5,11 @@ module.exports = {
5
5
  compare: `const {compare} = operator`,
6
6
  compareAll: `const {compareAll} = operator`,
7
7
  compareAny: `const {compareAny} = operator`,
8
+ compute: `const {compute} = operator`,
8
9
  contains: `const {contains} = operator`,
9
10
  declare: `const {declare} = operator`,
10
11
  extract: `const {extract} = operator`,
12
+ getPathAfterImports: `const {getPathAfterImports} = operator`,
11
13
  traverse: `const {traverse} = operator`,
12
14
  isSimpleRegExp: `const {isSimpleRegExp} = operator`,
13
15
  getTemplateValues: `const {getTemplateValues} = operator`,
package/lib/index.js CHANGED
@@ -13,6 +13,7 @@ module.exports.rules = {
13
13
  ...getRule('convert-to-no-transform-code'),
14
14
  ...getRule('convert-find-to-traverse'),
15
15
  ...getRule('convert-destructuring-to-identifier'),
16
+ ...getRule('convert-number-to-numeric'),
16
17
  ...getRule('convert-replace-with'),
17
18
  ...getRule('convert-replace-with-multiple'),
18
19
  ...getRule('convert-replace-to-function'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "11.7.0",
3
+ "version": "11.10.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",