putout 23.5.0 → 24.0.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 +78 -0
- package/README.md +1 -1
- package/lib/cli/eslint/index.js +8 -6
- package/lib/parse-options/index.js +1 -3
- package/package.json +8 -10
- package/putout.json +1 -4
package/ChangeLog
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
+
2022.01.12, v24.0.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- (putout) eslint-plugin-putout v13
|
|
5
|
+
- (@putout/plugin-nodejs) drop support of putout < 24
|
|
6
|
+
- (eslint-plugin-putout) drop support of putout < 24
|
|
7
|
+
- (eslint-plugin-putout) safe: disable nodejs/remove-process-exit
|
|
8
|
+
- (@putout/plugin-nodejs) merge remove-process-exit
|
|
9
|
+
- (putout) remove from default install disabled apply-array-it
|
|
10
|
+
- (package) @putout/plugin-package-json v3.0.0
|
|
11
|
+
- (package) @putout/plugin-putout v9.0.0
|
|
12
|
+
- (package) @putout/plugin-madrun v13.0.0
|
|
13
|
+
- (package) @putout/operate v7.0.0
|
|
14
|
+
- (@putout/plugin-putout) drop support of putout < 24
|
|
15
|
+
- (@putout/plugin-package-json) drop support of putout < 24
|
|
16
|
+
- (@putout/plugin-madrun) drop support of putout < 24
|
|
17
|
+
- (@putout/operate) findProperty -> getProperty
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
2022.01.11, v23.8.0
|
|
21
|
+
|
|
22
|
+
feature:
|
|
23
|
+
- (package) @putout/plugin-madrun v12.0.0
|
|
24
|
+
- (@putout/plugin-madrun) drop support of putout < 23
|
|
25
|
+
- (@putout/operate) add getExportDefault
|
|
26
|
+
- (@putout/plugin-madrun) add convert-cut-env-to-run
|
|
27
|
+
- (@putout/plugin-madrun) add convert-run-to-cut-env
|
|
28
|
+
- (@putout/plugin-remove-useless-spread) exclude comments
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
2022.01.10, v23.7.0
|
|
32
|
+
|
|
33
|
+
fix:
|
|
34
|
+
- (@putout/plugin-nodejs) convert-dirname-to-url
|
|
35
|
+
|
|
36
|
+
feature:
|
|
37
|
+
- (putout) eslint: add ability to pass config
|
|
38
|
+
- (eslint-plugin-putout) safe: disable remove-newline-from-empty-objects
|
|
39
|
+
- (eslint-plugin-putout) remove-newline-from-empty-object: add support of inner comments
|
|
40
|
+
- (@putout/plugin-remove-empty) add support of export
|
|
41
|
+
- (@putout/plugin-remove-empty) simplify namings
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
2022.01.09, v23.6.0
|
|
45
|
+
|
|
46
|
+
fix:
|
|
47
|
+
- (@putout/engine-runner) find: options
|
|
48
|
+
- (eslint-plugin-putout) add-newline-after-function-call: multiple empty lines
|
|
49
|
+
- feature(@putout/plugin-declare-undefined-variables) add fixtures
|
|
50
|
+
- feature(@putout/engine-runner) add support to clear replace watermarks after fix round is done
|
|
51
|
+
- (@putout/engine-parser) btoa: get back node v14 support
|
|
52
|
+
- (@putout/engine-parser) sourcemap url
|
|
53
|
+
|
|
54
|
+
feature:
|
|
55
|
+
- (package) @putout/plugin-nodejs v2.0.0
|
|
56
|
+
- (@putout/plugin-nodejs) drop support of putout < 23
|
|
57
|
+
- (@putout/plugin-nodejs) add convert-dirname-to-url
|
|
58
|
+
- (@putout/plugin-putout) declare: add isESM
|
|
59
|
+
- (package) @putout/plugin-convert-commonjs-to-esm v7.0.0
|
|
60
|
+
- (@putout/plugin-convert-commonjs-to-esm) drop support of putout < 23
|
|
61
|
+
- (@putout/plugin-convert-commonjs-to-esm) commonjs: use node.js built-ins, instead of simport
|
|
62
|
+
- (@putout/operator-declare) add ability to pass only "esm" or only "commonjs"
|
|
63
|
+
- (@putout/eslint-config) padding-line-between-statements: add newline before "for", after block-like
|
|
64
|
+
- (eslint-plugin-putout) add-newline-before-function-call: add support of AssignmentExpression
|
|
65
|
+
- (@putout/plugin-tape) add convert-equal-to-deep-equal
|
|
66
|
+
- (@putout/plugin-gitignore) add support of .idea
|
|
67
|
+
- (@putout/plugin-eslint) add apply-safe-align
|
|
68
|
+
- (eslint-plugin-putout) add safe+align
|
|
69
|
+
- (@putout/plugin-declare-undefined-variables) add fixtures
|
|
70
|
+
- (@putout/plugin-putout) declare: add compareAny, compareAll
|
|
71
|
+
- (@putout/plugin-putout) declare: add replaceWithMultiple
|
|
72
|
+
- (@putout/plugin-convert-commonjs-to-esm) require: add support of MemberExpression
|
|
73
|
+
- (@putout/plugin-tape) convert-equal-to-not-ok: add support of equal/notEqual with one argument passed
|
|
74
|
+
- (@putout/plugin-remove-useless-return) add support of nested functions
|
|
75
|
+
- (@putout/compare) is: parseTemplate: avoid caching exception as undefined
|
|
76
|
+
- (@putout/engine-runner) add support to clear replace watermarks after fix round is done
|
|
77
|
+
|
|
78
|
+
|
|
1
79
|
2021.12.30, v23.5.0
|
|
2
80
|
|
|
3
81
|
fix:
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
- declare `undefined variables`;
|
|
84
84
|
- apply `as` type assertions;
|
|
85
85
|
- apply `utility types`;
|
|
86
|
-
- apply `array.at` ([
|
|
86
|
+
- apply `array.at` ([not bundled](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#2021-07-29-version-1660-current-bethgriggs));
|
|
87
87
|
- apply `filter(Boolean)`;
|
|
88
88
|
- apply [isArray](https://web.mit.edu/jwalden/www/isArray.html);
|
|
89
89
|
- apply `if condition`;
|
package/lib/cli/eslint/index.js
CHANGED
|
@@ -28,13 +28,14 @@ const cutNewLine = ({message}) => ({
|
|
|
28
28
|
message: message.replace(/\n.*/, ''),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
const getESLint = ({fix}) => {
|
|
31
|
+
const getESLint = ({fix, config}) => {
|
|
32
32
|
const eslint = new ESLint({
|
|
33
33
|
fix,
|
|
34
34
|
overrideConfig: {
|
|
35
35
|
ignorePatterns: [
|
|
36
36
|
'!.*',
|
|
37
37
|
],
|
|
38
|
+
...config,
|
|
38
39
|
},
|
|
39
40
|
...overrideConfigFile && {
|
|
40
41
|
overrideConfigFile,
|
|
@@ -48,7 +49,7 @@ const getESLint = ({fix}) => {
|
|
|
48
49
|
};
|
|
49
50
|
};
|
|
50
51
|
|
|
51
|
-
module.exports = async ({name, code, fix}) => {
|
|
52
|
+
module.exports = async ({name, code, fix, config}) => {
|
|
52
53
|
const noChanges = [
|
|
53
54
|
code,
|
|
54
55
|
[],
|
|
@@ -59,6 +60,7 @@ module.exports = async ({name, code, fix}) => {
|
|
|
59
60
|
|
|
60
61
|
const [eslintError, eslint] = await tryToCatch(getESLint, {
|
|
61
62
|
fix,
|
|
63
|
+
config,
|
|
62
64
|
});
|
|
63
65
|
|
|
64
66
|
if (eslintError)
|
|
@@ -67,9 +69,9 @@ module.exports = async ({name, code, fix}) => {
|
|
|
67
69
|
[convertToPlace(cutNewLine(eslintError))],
|
|
68
70
|
];
|
|
69
71
|
|
|
70
|
-
const [configError,
|
|
72
|
+
const [configError, finalConfig] = await tryToCatch(eslint.calculateConfigForFile, name);
|
|
71
73
|
|
|
72
|
-
if (noConfigFound(
|
|
74
|
+
if (noConfigFound(finalConfig, configError))
|
|
73
75
|
return noChanges;
|
|
74
76
|
|
|
75
77
|
if (configError) {
|
|
@@ -79,10 +81,10 @@ module.exports = async ({name, code, fix}) => {
|
|
|
79
81
|
];
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
disablePutout(
|
|
84
|
+
disablePutout(finalConfig);
|
|
83
85
|
|
|
84
86
|
// that's right, we disabled "putout" rules in "config"
|
|
85
|
-
// and now it
|
|
87
|
+
// and now it located in eslint's cache
|
|
86
88
|
const results = await eslint.lintText(code, {
|
|
87
89
|
filePath: name,
|
|
88
90
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "putout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊 Pluggable and configurable code transformer with built-in eslint and babel plugins support of js, jsx typescript, flow files, markdown, yaml and json",
|
|
@@ -65,11 +65,10 @@
|
|
|
65
65
|
"@putout/formatter-progress": "^3.0.0",
|
|
66
66
|
"@putout/formatter-progress-bar": "^2.0.0",
|
|
67
67
|
"@putout/formatter-stream": "^3.0.0",
|
|
68
|
-
"@putout/operate": "^
|
|
68
|
+
"@putout/operate": "^7.0.0",
|
|
69
69
|
"@putout/operator-add-args": "^1.0.0",
|
|
70
70
|
"@putout/operator-declare": "^2.0.0",
|
|
71
71
|
"@putout/operator-regexp": "^1.0.0",
|
|
72
|
-
"@putout/plugin-apply-array-at": "^1.0.0",
|
|
73
72
|
"@putout/plugin-apply-as-type-assertions": "^1.0.0",
|
|
74
73
|
"@putout/plugin-apply-await-import": "^1.0.0",
|
|
75
74
|
"@putout/plugin-apply-destructuring": "^5.0.0",
|
|
@@ -85,7 +84,7 @@
|
|
|
85
84
|
"@putout/plugin-convert-assignment-to-arrow-function": "^1.0.0",
|
|
86
85
|
"@putout/plugin-convert-assignment-to-comparison": "^1.0.0",
|
|
87
86
|
"@putout/plugin-convert-bitwise-to-logical": "^1.0.0",
|
|
88
|
-
"@putout/plugin-convert-commonjs-to-esm": "^
|
|
87
|
+
"@putout/plugin-convert-commonjs-to-esm": "^7.0.0",
|
|
89
88
|
"@putout/plugin-convert-comparison-to-boolean": "^2.0.0",
|
|
90
89
|
"@putout/plugin-convert-concat-to-flat": "^1.0.0",
|
|
91
90
|
"@putout/plugin-convert-equal-to-strict-equal": "^1.0.0",
|
|
@@ -110,15 +109,15 @@
|
|
|
110
109
|
"@putout/plugin-extract-sequence-expressions": "^2.0.0",
|
|
111
110
|
"@putout/plugin-github": "^2.0.0",
|
|
112
111
|
"@putout/plugin-gitignore": "^3.0.0",
|
|
113
|
-
"@putout/plugin-madrun": "^
|
|
112
|
+
"@putout/plugin-madrun": "^13.0.0",
|
|
114
113
|
"@putout/plugin-merge-destructuring-properties": "^5.0.0",
|
|
115
114
|
"@putout/plugin-merge-duplicate-imports": "^4.0.0",
|
|
116
115
|
"@putout/plugin-merge-if-statements": "^3.0.0",
|
|
117
|
-
"@putout/plugin-nodejs": "^
|
|
116
|
+
"@putout/plugin-nodejs": "^2.0.0",
|
|
118
117
|
"@putout/plugin-npmignore": "^2.0.0",
|
|
119
|
-
"@putout/plugin-package-json": "^
|
|
118
|
+
"@putout/plugin-package-json": "^3.0.0",
|
|
120
119
|
"@putout/plugin-promises": "^6.0.0",
|
|
121
|
-
"@putout/plugin-putout": "^
|
|
120
|
+
"@putout/plugin-putout": "^9.0.0",
|
|
122
121
|
"@putout/plugin-putout-config": "^2.0.0",
|
|
123
122
|
"@putout/plugin-regexp": "^4.0.0",
|
|
124
123
|
"@putout/plugin-remove-boolean-from-assertions": "^1.0.0",
|
|
@@ -134,7 +133,6 @@
|
|
|
134
133
|
"@putout/plugin-remove-empty": "^6.0.0",
|
|
135
134
|
"@putout/plugin-remove-iife": "^1.0.0",
|
|
136
135
|
"@putout/plugin-remove-nested-blocks": "^4.0.0",
|
|
137
|
-
"@putout/plugin-remove-process-exit": "^3.0.0",
|
|
138
136
|
"@putout/plugin-remove-unreachable-code": "^1.0.0",
|
|
139
137
|
"@putout/plugin-remove-unreferenced-variables": "^1.0.0",
|
|
140
138
|
"@putout/plugin-remove-unused-expressions": "^4.0.0",
|
|
@@ -222,7 +220,7 @@
|
|
|
222
220
|
"currify": "^4.0.0",
|
|
223
221
|
"eslint": "^8.0.1",
|
|
224
222
|
"eslint-plugin-node": "^11.0.0",
|
|
225
|
-
"eslint-plugin-putout": "^
|
|
223
|
+
"eslint-plugin-putout": "^13.0.0",
|
|
226
224
|
"just-camel-case": "^4.0.2",
|
|
227
225
|
"lerna": "^4.0.0",
|
|
228
226
|
"madrun": "^8.6.0",
|
package/putout.json
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"package-json": "on"
|
|
69
69
|
},
|
|
70
70
|
"bin": {
|
|
71
|
-
"remove-process-exit": "off",
|
|
71
|
+
"nodejs/remove-process-exit": "off",
|
|
72
72
|
"remove-console": "off",
|
|
73
73
|
"convert-top-level-return": "on",
|
|
74
74
|
"remove-empty/import": "off"
|
|
@@ -111,7 +111,6 @@
|
|
|
111
111
|
"**/package-lock.json"
|
|
112
112
|
],
|
|
113
113
|
"rules": {
|
|
114
|
-
"apply-array-at": "off",
|
|
115
114
|
"apply-as-type-assertions": "off",
|
|
116
115
|
"apply-utility-types": "off",
|
|
117
116
|
"convert-esm-to-commonjs": "off",
|
|
@@ -139,7 +138,6 @@
|
|
|
139
138
|
"remove-duplicate-interface-keys": "off"
|
|
140
139
|
},
|
|
141
140
|
"plugins": [
|
|
142
|
-
"apply-array-at",
|
|
143
141
|
"apply-await-import",
|
|
144
142
|
"apply-is-array",
|
|
145
143
|
"apply-destructuring",
|
|
@@ -156,7 +154,6 @@
|
|
|
156
154
|
"package-json",
|
|
157
155
|
"remove-debugger",
|
|
158
156
|
"remove-iife",
|
|
159
|
-
"remove-process-exit",
|
|
160
157
|
"remove-console",
|
|
161
158
|
"remove-empty",
|
|
162
159
|
"remove-unreferenced-variables",
|