putout 22.8.1 → 23.1.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/ChangeLog CHANGED
@@ -1,3 +1,62 @@
1
+ 2021.12.23, v23.1.0
2
+
3
+ fix:
4
+ - (@putout/plugin-convert-for-to-for-of) entries: count i references (should be more then 3)
5
+
6
+ feature:
7
+ - (@putout/plugin-remove-useless-array-entries) add
8
+ - (@putout/plugin-convert-for-to-for-of) length: add support of destructuring
9
+ - (@putout/plugin-convert-for-to-for-of) entries: add support of destructuring
10
+ - (@putout/plugin-convert-for-to-for-of) add support of entries with declared n
11
+ - (@putout/plugin-convert-for-to-for-of) add support of entries
12
+ - (eslint-plugin-putout) no-unresolved: add support of export declarations
13
+ - (@putout/plugin-remove-useless-escape) set RegExp raw
14
+ - (@putout/plugin-remove-useless-escape) improve support of handling "," in RegExp
15
+ - (@putout/plugin-regexp) remove-useless-group: add support of Alternative
16
+
17
+
18
+ 2021.12.21, v23.0.0
19
+
20
+ feature:
21
+ - (package) @putout/engine-loader v5.0.0
22
+ - (package) @putout/engine-loader v5.0.0
23
+ - (package) @putout/plugin-regexp v4.0.0
24
+ - (@putout/plugin-regexp) drop support of putout < 23
25
+ - (putout) drop jscodeshift support
26
+ - (@putout/engine-loader) drop support of jscodeshift
27
+ - (putout) apply @putout/recast v1.5.1 modifications
28
+ - (eslint-plugin-putout) putout: add ability parse error instead of throw
29
+ - (eslint-plugin-putout) ts: add no-redeclare
30
+ - (@putout/plugin-tape) add-await-to-re-import: add support of nested blocks
31
+
32
+
33
+ 2021.12.20, v22.9.0
34
+
35
+ fix:
36
+ - (@putout/plugin-putout) convert-replace-with: crawl
37
+
38
+ feature:
39
+ - (@putout/plugin-apply-await-import) exclude cases where parent not VariableDeclarator
40
+ - (@putout/plugin-apply-await-import) add
41
+ - (@putout/plugin-putout) declare: add replaceWith
42
+ - (@putout/plugin-tape) add-args: add support of async functions
43
+ - (package) ts-morph v13.0.2
44
+ - (@putout/plugin-declare-undefined-variables) add support of url
45
+ - (@putout/engine-loader) improve Yarn PnP support (#93)
46
+ - (@putout/plugin-remove-useless-return) improve handling of call expressions
47
+ - (@putout/plugin-tape) add-t-end: exclude case where callback used
48
+
49
+
50
+ 2021.12.16, v22.8.2
51
+
52
+ fix:
53
+ - (@putout/formatter-memory) memry -> memory
54
+
55
+ feature:
56
+ - (putout) options: ignore: add .pnp.*
57
+ - (@putout/engine-loader) improve support of Yarn PnP (#93)
58
+
59
+
1
60
  2021.12.15, v22.8.1
2
61
 
3
62
  feature:
package/README.md CHANGED
@@ -36,6 +36,7 @@
36
36
  - remove useless `typeof`;
37
37
  - remove useless `template expressions`;
38
38
  - remove useless `for-of`;
39
+ - remove useless `array.entries()`;
39
40
  - remove `debugger` statement;
40
41
  - remove `iife`;
41
42
  - remove nested blocks;
@@ -86,6 +87,7 @@
86
87
  - apply `filter(Boolean)`;
87
88
  - apply [isArray](https://web.mit.edu/jwalden/www/isArray.html);
88
89
  - apply `if condition`;
90
+ - apply `await import`;
89
91
 
90
92
  ## Why?
91
93
 
package/lib/ignores.js CHANGED
@@ -17,10 +17,7 @@ module.exports = (dirOpt, resolvedName, options = {}) => {
17
17
  };
18
18
 
19
19
  function mergeIgnores(ignores) {
20
- const n = ignores.length;
21
-
22
- for (let i = 0; i < n; i++) {
23
- const str = ignores[i];
20
+ for (const [i, str] of ignores.entries()) {
24
21
  const positiveIndex = ignores.indexOf(positive(str));
25
22
 
26
23
  if (isNegative(str) && positiveIndex > i)
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "22.8.1",
3
+ "version": "23.1.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
- "description": "🐊 Pluggable and configurable code transformer with built-in eslint, babel plugins and jscodeshift codemods support of js, jsx typescript, flow files, markdown, yaml and json",
5
+ "description": "🐊 Pluggable and configurable code transformer with built-in eslint and babel plugins support of js, jsx typescript, flow files, markdown, yaml and json",
6
6
  "homepage": "http://github.com/coderaiser/putout",
7
7
  "main": "./lib/putout.js",
8
8
  "exports": {
@@ -51,7 +51,7 @@
51
51
  "@putout/cli-ruler": "^1.0.0",
52
52
  "@putout/cli-validate-args": "^1.0.0",
53
53
  "@putout/compare": "^8.0.0",
54
- "@putout/engine-loader": "^4.0.0",
54
+ "@putout/engine-loader": "^5.0.0",
55
55
  "@putout/engine-parser": "^4.0.0",
56
56
  "@putout/engine-processor": "^4.0.0",
57
57
  "@putout/engine-runner": "^11.0.0",
@@ -70,6 +70,7 @@
70
70
  "@putout/operator-regexp": "^1.0.0",
71
71
  "@putout/plugin-apply-array-at": "^1.0.0",
72
72
  "@putout/plugin-apply-as-type-assertions": "^1.0.0",
73
+ "@putout/plugin-apply-await-import": "^1.0.0",
73
74
  "@putout/plugin-apply-destructuring": "^5.0.0",
74
75
  "@putout/plugin-apply-if-condition": "^1.0.0",
75
76
  "@putout/plugin-apply-is-array": "^2.0.0",
@@ -118,7 +119,7 @@
118
119
  "@putout/plugin-promises": "^6.0.0",
119
120
  "@putout/plugin-putout": "^8.0.0",
120
121
  "@putout/plugin-putout-config": "^2.0.0",
121
- "@putout/plugin-regexp": "^3.0.0",
122
+ "@putout/plugin-regexp": "^4.0.0",
122
123
  "@putout/plugin-remove-boolean-from-assertions": "^1.0.0",
123
124
  "@putout/plugin-remove-boolean-from-logical-expressions": "^4.0.0",
124
125
  "@putout/plugin-remove-console": "^3.0.0",
@@ -142,6 +143,7 @@
142
143
  "@putout/plugin-remove-unused-variables": "*",
143
144
  "@putout/plugin-remove-useless-arguments": "^5.0.0",
144
145
  "@putout/plugin-remove-useless-array-constructor": "^1.0.0",
146
+ "@putout/plugin-remove-useless-array-entries": "^1.0.0",
145
147
  "@putout/plugin-remove-useless-array-from": "^2.0.0",
146
148
  "@putout/plugin-remove-useless-conditions": "^1.0.0",
147
149
  "@putout/plugin-remove-useless-constructor": "^1.0.0",
@@ -214,7 +216,6 @@
214
216
  "devDependencies": {
215
217
  "@babel/plugin-transform-react-jsx": "^7.14.5",
216
218
  "@cloudcmd/stub": "^3.0.0",
217
- "async-await-codemod": "https://github.com/sgilroy/async-await-codemod.git",
218
219
  "babel-plugin-transform-inline-consecutive-adds": "^0.5.0-alpha.9",
219
220
  "c8": "^7.5.0",
220
221
  "currify": "^4.0.0",
package/putout.json CHANGED
@@ -103,6 +103,7 @@
103
103
  "**/fixture",
104
104
  "**/.nyc_output",
105
105
  "**/.yarn",
106
+ "**/.pnp.*",
106
107
  "**/coverage",
107
108
  "**/dist",
108
109
  "**/dist-dev",
@@ -139,6 +140,7 @@
139
140
  },
140
141
  "plugins": [
141
142
  "apply-array-at",
143
+ "apply-await-import",
142
144
  "apply-is-array",
143
145
  "apply-destructuring",
144
146
  "apply-optional-chaining",
@@ -185,6 +187,7 @@
185
187
  "remove-useless-functions",
186
188
  "remove-useless-template-expressions",
187
189
  "remove-useless-for-of",
190
+ "remove-useless-array-entries",
188
191
  "remove-constant-conditions",
189
192
  "remove-boolean-from-assertions",
190
193
  "remove-boolean-from-logical-expressions",