putout 23.6.0 → 24.0.1
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 +50 -0
- package/README.md +1 -1
- package/lib/cli/eslint/index.js +8 -6
- package/package.json +6 -9
- package/putout.json +3 -7
package/ChangeLog
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
2022.01.13, v24.0.1
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- (@putout/plugin-nodejs) merge convert-top-level-return
|
|
5
|
+
- (@putout/plugin-putout) declare: add getProperty, getProperties
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
2022.01.12, v24.0.0
|
|
9
|
+
|
|
10
|
+
feature:
|
|
11
|
+
- (putout) eslint-plugin-putout v13
|
|
12
|
+
- (@putout/plugin-nodejs) drop support of putout < 24
|
|
13
|
+
- (eslint-plugin-putout) drop support of putout < 24
|
|
14
|
+
- (eslint-plugin-putout) safe: disable nodejs/remove-process-exit
|
|
15
|
+
- (@putout/plugin-nodejs) merge remove-process-exit
|
|
16
|
+
- (putout) remove from default install disabled apply-array-it
|
|
17
|
+
- (package) @putout/plugin-package-json v3.0.0
|
|
18
|
+
- (package) @putout/plugin-putout v9.0.0
|
|
19
|
+
- (package) @putout/plugin-madrun v13.0.0
|
|
20
|
+
- (package) @putout/operate v7.0.0
|
|
21
|
+
- (@putout/plugin-putout) drop support of putout < 24
|
|
22
|
+
- (@putout/plugin-package-json) drop support of putout < 24
|
|
23
|
+
- (@putout/plugin-madrun) drop support of putout < 24
|
|
24
|
+
- (@putout/operate) findProperty -> getProperty
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
2022.01.11, v23.8.0
|
|
28
|
+
|
|
29
|
+
feature:
|
|
30
|
+
- (package) @putout/plugin-madrun v12.0.0
|
|
31
|
+
- (@putout/plugin-madrun) drop support of putout < 23
|
|
32
|
+
- (@putout/operate) add getExportDefault
|
|
33
|
+
- (@putout/plugin-madrun) add convert-cut-env-to-run
|
|
34
|
+
- (@putout/plugin-madrun) add convert-run-to-cut-env
|
|
35
|
+
- (@putout/plugin-remove-useless-spread) exclude comments
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
2022.01.10, v23.7.0
|
|
39
|
+
|
|
40
|
+
fix:
|
|
41
|
+
- (@putout/plugin-nodejs) convert-dirname-to-url
|
|
42
|
+
|
|
43
|
+
feature:
|
|
44
|
+
- (putout) eslint: add ability to pass config
|
|
45
|
+
- (eslint-plugin-putout) safe: disable remove-newline-from-empty-objects
|
|
46
|
+
- (eslint-plugin-putout) remove-newline-from-empty-object: add support of inner comments
|
|
47
|
+
- (@putout/plugin-remove-empty) add support of export
|
|
48
|
+
- (@putout/plugin-remove-empty) simplify namings
|
|
49
|
+
|
|
50
|
+
|
|
1
51
|
2022.01.09, v23.6.0
|
|
2
52
|
|
|
3
53
|
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.1",
|
|
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",
|
|
@@ -102,7 +101,6 @@
|
|
|
102
101
|
"@putout/plugin-convert-quotes-to-backticks": "^1.0.0",
|
|
103
102
|
"@putout/plugin-convert-template-to-string": "^1.0.0",
|
|
104
103
|
"@putout/plugin-convert-to-arrow-function": "^3.0.0",
|
|
105
|
-
"@putout/plugin-convert-top-level-return": "^4.0.0",
|
|
106
104
|
"@putout/plugin-convert-typeof-to-is-type": "^2.0.0",
|
|
107
105
|
"@putout/plugin-declare-undefined-variables": "^6.0.0",
|
|
108
106
|
"@putout/plugin-eslint": "^2.0.0",
|
|
@@ -110,15 +108,15 @@
|
|
|
110
108
|
"@putout/plugin-extract-sequence-expressions": "^2.0.0",
|
|
111
109
|
"@putout/plugin-github": "^2.0.0",
|
|
112
110
|
"@putout/plugin-gitignore": "^3.0.0",
|
|
113
|
-
"@putout/plugin-madrun": "^
|
|
111
|
+
"@putout/plugin-madrun": "^13.0.0",
|
|
114
112
|
"@putout/plugin-merge-destructuring-properties": "^5.0.0",
|
|
115
113
|
"@putout/plugin-merge-duplicate-imports": "^4.0.0",
|
|
116
114
|
"@putout/plugin-merge-if-statements": "^3.0.0",
|
|
117
115
|
"@putout/plugin-nodejs": "^2.0.0",
|
|
118
116
|
"@putout/plugin-npmignore": "^2.0.0",
|
|
119
|
-
"@putout/plugin-package-json": "^
|
|
117
|
+
"@putout/plugin-package-json": "^3.0.0",
|
|
120
118
|
"@putout/plugin-promises": "^6.0.0",
|
|
121
|
-
"@putout/plugin-putout": "^
|
|
119
|
+
"@putout/plugin-putout": "^9.0.0",
|
|
122
120
|
"@putout/plugin-putout-config": "^2.0.0",
|
|
123
121
|
"@putout/plugin-regexp": "^4.0.0",
|
|
124
122
|
"@putout/plugin-remove-boolean-from-assertions": "^1.0.0",
|
|
@@ -134,7 +132,6 @@
|
|
|
134
132
|
"@putout/plugin-remove-empty": "^6.0.0",
|
|
135
133
|
"@putout/plugin-remove-iife": "^1.0.0",
|
|
136
134
|
"@putout/plugin-remove-nested-blocks": "^4.0.0",
|
|
137
|
-
"@putout/plugin-remove-process-exit": "^3.0.0",
|
|
138
135
|
"@putout/plugin-remove-unreachable-code": "^1.0.0",
|
|
139
136
|
"@putout/plugin-remove-unreferenced-variables": "^1.0.0",
|
|
140
137
|
"@putout/plugin-remove-unused-expressions": "^4.0.0",
|
|
@@ -222,7 +219,7 @@
|
|
|
222
219
|
"currify": "^4.0.0",
|
|
223
220
|
"eslint": "^8.0.1",
|
|
224
221
|
"eslint-plugin-node": "^11.0.0",
|
|
225
|
-
"eslint-plugin-putout": "^
|
|
222
|
+
"eslint-plugin-putout": "^13.0.0",
|
|
226
223
|
"just-camel-case": "^4.0.2",
|
|
227
224
|
"lerna": "^4.0.0",
|
|
228
225
|
"madrun": "^8.6.0",
|
package/putout.json
CHANGED
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"package-json": "on"
|
|
69
69
|
},
|
|
70
70
|
"bin": {
|
|
71
|
-
"remove-process-exit": "off",
|
|
71
|
+
"nodejs/remove-process-exit": "off",
|
|
72
|
+
"nodejs/convert-top-level-return": "on",
|
|
72
73
|
"remove-console": "off",
|
|
73
|
-
"convert-top-level-return": "on",
|
|
74
74
|
"remove-empty/import": "off"
|
|
75
75
|
},
|
|
76
76
|
"{test,*.spec.{js,mjs,cjs}}": {
|
|
@@ -111,12 +111,11 @@
|
|
|
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",
|
|
118
117
|
"convert-commonjs-to-esm": "off",
|
|
119
|
-
"convert-top-level-return": "off",
|
|
118
|
+
"nodejs/convert-top-level-return": "off",
|
|
120
119
|
"convert-generic-to-shorthand": "off",
|
|
121
120
|
"remove-useless-types": "off",
|
|
122
121
|
"remove-useless-mapped-types": "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",
|
|
@@ -218,7 +215,6 @@
|
|
|
218
215
|
"convert-for-each-to-for-of",
|
|
219
216
|
"convert-for-in-to-for-of",
|
|
220
217
|
"convert-map-to-for-of",
|
|
221
|
-
"convert-top-level-return",
|
|
222
218
|
"convert-typeof-to-is-type",
|
|
223
219
|
"convert-array-copy-to-slice",
|
|
224
220
|
"convert-template-to-string",
|