putout 22.6.0 → 22.8.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,78 @@
1
+ 2021.12.15, v22.8.0
2
+
3
+ fix:
4
+ - (@putout/processor-css) disable property-no-vendor-prefix, selector-no-vendor-prefix
5
+ - (@putout/engine-parser) try-catch: devDependencies -> dependencies (#92)
6
+ - (@putout/operate) try-catch: dependencies -> devDependencies
7
+
8
+ feature:
9
+ - (putout) formatters: use chalk v4 to have support of Yarn PnP (https://github.com/yarnpkg/berry/issues/3843)
10
+ - (putout) add support of yarn PnP by formatters loader (#93)
11
+ - (@putout/engine-loader) add support of Yarn PnP (#93)
12
+ - (package) stylelint-config-standard v24.0.0
13
+ - (package) stylelint v14.1.0
14
+ - (@putout/operate) compute: nested MemberExpressions: extract -> compute
15
+ - (@putout/plugin-convert-typeof-to-is-type) exclude undefined undeclared
16
+ - (@putout/operate) compute: exclude values of MemberExpression that cannot be extracted
17
+ - (@putout/plugin-remove-useless-variables) for-of: add support of ArrayPattern
18
+ - (eslint-plugin-putout) wrap: add getSpacesAfterNode
19
+ - (@putout/plugin-putout) add apply-create-test
20
+ - (@putout/plugin-putout) add convert-dirname-to-url
21
+ - (@putout/operator-declare) use isESM from @putout/operate
22
+ - (@putout/operate) add isESM
23
+ - (@putout/formatter-progress-bar) add color constant
24
+ - (@putout/operate) compute: isSimbleMemberExpression: simplify object check: not MemberExpression, not CallExpression -> not computed and Identifier'
25
+
26
+
27
+ 2021.12.12, v22.7.0
28
+
29
+ feature:
30
+ - (package) @putout/plugin-convert-comparison-to-boolean v2.0.0
31
+ - (@putout/operate) compute: add support of evaluate
32
+ - (@putout/plugin-convert-comparison-to-boolean) improve support of member expressions
33
+ - (@putout/plugin-convert-comparison-to-boolean) drop support of putout < 22
34
+ - (@putout/plugin-putout) check-replace-code: simplify
35
+ - (@putout/operate) compute: add support of Literal
36
+ - (@putout/plugin-putout) check-replace-code: use compute from operate
37
+ - (@putout/operate) add compute
38
+ - (@putout/plugin-putout) check-replace-code: add support of MemberExpression in computed property
39
+ - (@putout/plugin-convert-typeof-to-is-type) use getBindingPath from operate
40
+ - (@putout/operate) add getBinding, getBindingPath
41
+ - (@putout/operate) add getBinding
42
+ - (@putout/engine-runner) replace: validation output: ["__b"] ["__a"] -> ["__a"] -> ["__b"]
43
+ - (@putout/plugin-putout) add move-require-on-top-level
44
+ - (@putout/test) add support of createTest
45
+ - (@putout/engine-loader) is-enabled: use isBool
46
+ - (@putout/plugin-convert-typeof-to-is-type) improve binding search
47
+ - (@putout/plugin-putout) check-replace-code: exclude computed keys
48
+ - (@putout/plugin-convert-typeof-to-is-type) add support of isSymbol
49
+ - (@putout/plugin-declare-undefined-variables) add support of isSymbol
50
+
51
+ 2021.12.09, v22.6.2
52
+
53
+ fix:
54
+ - (eslint-plugin-putout) putout: traverse: use faster version
55
+
56
+ feature:
57
+ - (package) @putout/plugin-remove-useless-return v4.0.0
58
+ - (eslint-plugin-putout) safe: disable no-useless-return
59
+ - (@putout/plugin-remove-useless-return) report: Useless "return" should be avoided -> Avoid useless "return"
60
+ - (@putout/eslint-config) add space-in-parens
61
+ - (eslint-plugin-putout) putout: simplify according to https://github.com/eslint/eslint/issues/15394#issuecomment-989410995
62
+ - (package) @babel/traverse v7.16.3
63
+
64
+
65
+ 2021.12.08, v22.6.1
66
+
67
+ fix:
68
+ - (putout) transform: runPlugins: rm useless parser
69
+
70
+ feature:
71
+ - (@putout/plugin-declare-undefined-variables) wrap: add returns
72
+ - (eslint-plugin-putout) putout: add ability to remove parent, it makes recast go crazy (https://github.com/eslint/eslint/blob/v8.4.0/lib/linter/linter.js#L964)
73
+ - (eslint-plugin-putout) putout: use generate, when recast cannot print
74
+
75
+
1
76
  2021.12.07, v22.6.0
2
77
 
3
78
  feature:
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const {createSimport} = require('simport');
4
3
  const tryToCatch = require('try-to-catch');
5
4
 
6
5
  const {
@@ -8,7 +7,8 @@ const {
8
7
  CANNOT_LOAD_FORMATTER,
9
8
  } = require('./exit-codes');
10
9
 
11
- const simport = createSimport(__filename);
10
+ const simpleImport = require('./simple-import');
11
+
12
12
  const stub = () => () => {};
13
13
 
14
14
  const {isArray} = Array;
@@ -48,7 +48,7 @@ async function loadFormatter(names) {
48
48
  let reporter;
49
49
 
50
50
  for (const name of names) {
51
- [e, reporter] = await tryToCatch(simport, name);
51
+ [e, reporter] = await tryToCatch(simpleImport, name);
52
52
 
53
53
  if (!e)
54
54
  return [null, reporter];
@@ -69,3 +69,4 @@ async function loadFormatter(names) {
69
69
 
70
70
  return [e];
71
71
  }
72
+
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ // yarn doesn't understand how simport works
4
+ // https://github.com/coderaiser/putout/issues/93
5
+
6
+ module.exports = async (url) => (await import(url)).default;
7
+
package/lib/putout.js CHANGED
@@ -84,7 +84,6 @@ function transform(ast, source, opts) {
84
84
  rules,
85
85
  fix,
86
86
  fixCount,
87
- parser,
88
87
  loadPlugins,
89
88
  runPlugins,
90
89
  } = opts;
@@ -102,7 +101,6 @@ function transform(ast, source, opts) {
102
101
  fix,
103
102
  fixCount,
104
103
  plugins,
105
- parser,
106
104
  });
107
105
 
108
106
  return places;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "22.6.0",
3
+ "version": "22.8.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
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",
6
6
  "homepage": "http://github.com/coderaiser/putout",
@@ -84,7 +84,7 @@
84
84
  "@putout/plugin-convert-assignment-to-comparison": "^1.0.0",
85
85
  "@putout/plugin-convert-bitwise-to-logical": "^1.0.0",
86
86
  "@putout/plugin-convert-commonjs-to-esm": "^6.0.0",
87
- "@putout/plugin-convert-comparison-to-boolean": "^1.0.0",
87
+ "@putout/plugin-convert-comparison-to-boolean": "^2.0.0",
88
88
  "@putout/plugin-convert-concat-to-flat": "^1.0.0",
89
89
  "@putout/plugin-convert-equal-to-strict-equal": "^1.0.0",
90
90
  "@putout/plugin-convert-esm-to-commonjs": "^3.0.0",
@@ -154,7 +154,7 @@
154
154
  "@putout/plugin-remove-useless-mapping-modifiers": "^1.0.0",
155
155
  "@putout/plugin-remove-useless-new": "^1.0.0",
156
156
  "@putout/plugin-remove-useless-operand": "^1.0.0",
157
- "@putout/plugin-remove-useless-return": "^3.0.0",
157
+ "@putout/plugin-remove-useless-return": "^4.0.0",
158
158
  "@putout/plugin-remove-useless-spread": "^5.0.0",
159
159
  "@putout/plugin-remove-useless-template-expressions": "^1.0.0",
160
160
  "@putout/plugin-remove-useless-type-conversion": "^1.0.0",