putout 30.2.1 → 30.2.3
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 +17 -0
- package/README.md +0 -1
- package/help.json +0 -1
- package/lib/cli/index.js +0 -4
- package/lib/cli/process-file.js +1 -2
- package/lib/cli/runner/worker.js +1 -2
- package/lib/putout.js +0 -9
- package/package.json +3 -3
package/ChangeLog
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
2023.07.10, v30.2.3
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 830e1b0d4 package: @putout/plugin-remove-unreferenced-variables v3.0.0
|
|
5
|
+
- 699b8f2c7 package: @putout/plugin-for-of v2.0.0
|
|
6
|
+
- 3fc4a114c @putout/plugin-for-of: drop support of 🐊 < 30
|
|
7
|
+
- 58b201cd1 @putout/plugin-for-of: improve support of @putout/plugin-remove-unreferenced-variables
|
|
8
|
+
- b1e7d140c @putout/plugin-remove-unreferenced-variables: drop support of 🐊 < 30
|
|
9
|
+
- 54bbefbf3 @putout/plugin-remove-unreferenced-variables: improve support of @putout/plugin-for-of
|
|
10
|
+
- fb9b9df38 @putout/plugin-promises: add-missing-await: react: exclude useEffect
|
|
11
|
+
- 80bf66dc5 @putout/plugin-promises: convert-new-promise-to-async: exclude names other then resolve, reject
|
|
12
|
+
|
|
13
|
+
2023.07.10, v30.2.2
|
|
14
|
+
|
|
15
|
+
fix:
|
|
16
|
+
- b12de56b3 putout: --soft: has no sense, since after fix places.length always none
|
|
17
|
+
|
|
1
18
|
2023.07.10, v30.2.1
|
|
2
19
|
|
|
3
20
|
feature:
|
package/README.md
CHANGED
|
@@ -178,7 +178,6 @@ Options:
|
|
|
178
178
|
--match [pattern] read '.putout.json' and convert 'rules' to 'match' according to 'pattern'
|
|
179
179
|
--flow enable flow
|
|
180
180
|
--fresh generate a fresh cache
|
|
181
|
-
--soft avoid source change when no places found
|
|
182
181
|
--no-config avoid reading '.putout.json'
|
|
183
182
|
--no-ci disable the CI detection
|
|
184
183
|
--no-cache disable the cache
|
package/help.json
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"--match [pattern] ": "read '.putout.json' and convert 'rules' to 'match' according to 'pattern'",
|
|
16
16
|
"--flow ": "enable flow",
|
|
17
17
|
"--fresh ": "generate a fresh cache",
|
|
18
|
-
"--soft ": "avoid source change when no places found",
|
|
19
18
|
"--no-config ": "avoid reading '.putout.json'",
|
|
20
19
|
"--no-ci ": "disable the CI detection",
|
|
21
20
|
"--no-cache ": "disable the cache"
|
package/lib/cli/index.js
CHANGED
|
@@ -76,7 +76,6 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
|
|
|
76
76
|
'help',
|
|
77
77
|
'fix',
|
|
78
78
|
'fresh',
|
|
79
|
-
'soft',
|
|
80
79
|
'raw',
|
|
81
80
|
'enable-all',
|
|
82
81
|
'disable-all',
|
|
@@ -113,7 +112,6 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
|
|
|
113
112
|
disableAll: false,
|
|
114
113
|
enableAll: false,
|
|
115
114
|
plugins: [],
|
|
116
|
-
soft: false,
|
|
117
115
|
},
|
|
118
116
|
};
|
|
119
117
|
|
|
@@ -126,7 +124,6 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
|
|
|
126
124
|
|
|
127
125
|
const {
|
|
128
126
|
fix,
|
|
129
|
-
soft,
|
|
130
127
|
fixCount,
|
|
131
128
|
raw,
|
|
132
129
|
rulesdir,
|
|
@@ -279,7 +276,6 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
|
|
|
279
276
|
|
|
280
277
|
const options = {
|
|
281
278
|
fix,
|
|
282
|
-
soft,
|
|
283
279
|
isFlow,
|
|
284
280
|
fixCount,
|
|
285
281
|
raw,
|
package/lib/cli/process-file.js
CHANGED
|
@@ -16,13 +16,12 @@ const getMatchedOptions = (name, options) => {
|
|
|
16
16
|
return merge(options, parseMatch(name, options.match));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
module.exports = ({fix,
|
|
19
|
+
module.exports = ({fix, fixCount, isFlow, logError, raw, printer}) => async ({name, source, startLine, options}) => {
|
|
20
20
|
const isTS = /\.tsx?$/.test(name) || /{tsx?}$/.test(name);
|
|
21
21
|
const matchedOptions = getMatchedOptions(name, options);
|
|
22
22
|
|
|
23
23
|
const [e, result] = tryCatch(putout, source, {
|
|
24
24
|
fix,
|
|
25
|
-
soft,
|
|
26
25
|
fixCount,
|
|
27
26
|
isTS,
|
|
28
27
|
isFlow,
|
package/lib/cli/runner/worker.js
CHANGED
|
@@ -26,7 +26,7 @@ const createFormatterProxy = (options) => {
|
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
module.exports = async ({readFile, report, writeFile, exit, raw, write, log, currentFormat, rulesdir, formatterOptions, noConfig, transform, plugins, index, fix,
|
|
29
|
+
module.exports = async ({readFile, report, writeFile, exit, raw, write, log, currentFormat, rulesdir, formatterOptions, noConfig, transform, plugins, index, fix, processFile, processorRunners, fileCache, name, count}) => {
|
|
30
30
|
const resolvedName = resolve(name).replace(/^\./, cwd);
|
|
31
31
|
|
|
32
32
|
const [configError, options] = tryCatch(getOptions, {
|
|
@@ -69,7 +69,6 @@ module.exports = async ({readFile, report, writeFile, exit, raw, write, log, cur
|
|
|
69
69
|
raw,
|
|
70
70
|
dir,
|
|
71
71
|
fix,
|
|
72
|
-
soft,
|
|
73
72
|
options,
|
|
74
73
|
processorRunners,
|
|
75
74
|
log,
|
package/lib/putout.js
CHANGED
|
@@ -25,7 +25,6 @@ const defaultOpts = (opts = {}) => {
|
|
|
25
25
|
fixCount = 2,
|
|
26
26
|
loadPlugins = loader.loadPlugins,
|
|
27
27
|
runPlugins = runner.runPlugins,
|
|
28
|
-
soft = false,
|
|
29
28
|
} = opts;
|
|
30
29
|
|
|
31
30
|
return {
|
|
@@ -33,7 +32,6 @@ const defaultOpts = (opts = {}) => {
|
|
|
33
32
|
parser,
|
|
34
33
|
printer,
|
|
35
34
|
fix,
|
|
36
|
-
soft,
|
|
37
35
|
fixCount,
|
|
38
36
|
loadPlugins,
|
|
39
37
|
runPlugins,
|
|
@@ -52,7 +50,6 @@ module.exports = (source, opts) => {
|
|
|
52
50
|
sourceFileName,
|
|
53
51
|
sourceMapName,
|
|
54
52
|
printer,
|
|
55
|
-
soft,
|
|
56
53
|
} = opts;
|
|
57
54
|
|
|
58
55
|
const [clearSource, shebang] = cutShebang(source);
|
|
@@ -68,12 +65,6 @@ module.exports = (source, opts) => {
|
|
|
68
65
|
|
|
69
66
|
const places = transform(ast, source, opts);
|
|
70
67
|
|
|
71
|
-
if (!places.length && soft)
|
|
72
|
-
return {
|
|
73
|
-
code: source,
|
|
74
|
-
places: [],
|
|
75
|
-
};
|
|
76
|
-
|
|
77
68
|
if (!opts.fix)
|
|
78
69
|
return {
|
|
79
70
|
code: source,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "putout",
|
|
3
|
-
"version": "30.2.
|
|
3
|
+
"version": "30.2.3",
|
|
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, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@putout/plugin-eslint": "^5.0.0",
|
|
102
102
|
"@putout/plugin-extract-object-properties": "^9.0.0",
|
|
103
103
|
"@putout/plugin-extract-sequence-expressions": "^3.0.0",
|
|
104
|
-
"@putout/plugin-for-of": "^
|
|
104
|
+
"@putout/plugin-for-of": "^2.0.0",
|
|
105
105
|
"@putout/plugin-github": "^5.0.0",
|
|
106
106
|
"@putout/plugin-gitignore": "^3.0.0",
|
|
107
107
|
"@putout/plugin-logical-expressions": "^2.0.0",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@putout/plugin-remove-iife": "^4.0.0",
|
|
131
131
|
"@putout/plugin-remove-nested-blocks": "^6.0.0",
|
|
132
132
|
"@putout/plugin-remove-unreachable-code": "^1.0.0",
|
|
133
|
-
"@putout/plugin-remove-unreferenced-variables": "^
|
|
133
|
+
"@putout/plugin-remove-unreferenced-variables": "^3.0.0",
|
|
134
134
|
"@putout/plugin-remove-unused-expressions": "^7.0.0",
|
|
135
135
|
"@putout/plugin-remove-unused-for-of-variables": "^3.0.0",
|
|
136
136
|
"@putout/plugin-remove-unused-private-fields": "^2.0.0",
|