putout 30.2.0 → 30.2.2

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,17 @@
1
+ 2023.07.10, v30.2.2
2
+
3
+ fix:
4
+ - b12de56b3 putout: --soft: has no sense, since after fix places.length always none
5
+
6
+ 2023.07.10, v30.2.1
7
+
8
+ feature:
9
+ - e5edb5389 package: @putout/plugin-remove-useless-functions v3.0.0
10
+ - f1c7edb07 @putout/plugin-remove-useless-functions: report
11
+ - 9f4667994 @putout/plugin-promises: convert-new-promise-to-async: different scopes
12
+ - a1ea8101b package: estree-to-babel v6.0.0
13
+ - 6f1f0a97a @putout/operator-add-args: improve support of more then two params
14
+
1
15
  2023.07.08, v30.2.0
2
16
 
3
17
  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,
@@ -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, soft, fixCount, isFlow, logError, raw, printer}) => async ({name, source, startLine, options}) => {
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,
@@ -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, soft, processFile, processorRunners, fileCache, name, count}) => {
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.0",
3
+ "version": "30.2.2",
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",
@@ -143,7 +143,7 @@
143
143
  "@putout/plugin-remove-useless-continue": "^2.0.0",
144
144
  "@putout/plugin-remove-useless-else": "^2.0.0",
145
145
  "@putout/plugin-remove-useless-escape": "^3.0.0",
146
- "@putout/plugin-remove-useless-functions": "^2.0.0",
146
+ "@putout/plugin-remove-useless-functions": "^3.0.0",
147
147
  "@putout/plugin-remove-useless-map": "^1.0.0",
148
148
  "@putout/plugin-remove-useless-operand": "^2.0.0",
149
149
  "@putout/plugin-remove-useless-replace": "^1.0.1",