putout 30.1.0 → 30.2.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,24 @@
1
+ 2023.07.08, v30.2.0
2
+
3
+ feature:
4
+ - 2989df2d6 package: @putout/plugin-strict-mode v7.0.0
5
+ - 1fa43e078 package: @putout/plugin-putout v13.0.0
6
+ - ca3aac450 package: @putout/plugin-remove-unused-expressions v7.0.0
7
+ - f5fbabe8c @putout/plugin-remove-unused-expressions: drop support of 🐊 < 30
8
+ - d28a985ce @putout/engine-parser: use directives for @putout/printer
9
+ - 3e98931c4 @putout/plugin-putout: drop support of 🐊 < 30
10
+ - 3b6348134 @putout/plugin-strict-mode: drop support of 🐊 < 30
11
+ - 6ae6ec300 @putout/plugin-strict-mode: add support of directives
12
+
13
+ 2023.07.07, v30.1.1
14
+
15
+ fix:
16
+ - a85468f84 putout: --no-force -> --soft
17
+ - 349b3f37d @putout/test: UPDATE
18
+
19
+ feature:
20
+ - d2a54529b @putout/test: drop formatSave, formatManySave
21
+
1
22
  2023.07.06, v30.1.0
2
23
 
3
24
  feature:
package/README.md CHANGED
@@ -178,10 +178,10 @@ 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
181
182
  --no-config avoid reading '.putout.json'
182
183
  --no-ci disable the CI detection
183
184
  --no-cache disable the cache
184
- --no-force avoid source change when no places found
185
185
  ```
186
186
 
187
187
  To find errors:
package/help.json CHANGED
@@ -15,8 +15,8 @@
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",
18
19
  "--no-config ": "avoid reading '.putout.json'",
19
20
  "--no-ci ": "disable the CI detection",
20
- "--no-cache ": "disable the cache",
21
- "--no-force ": "avoid source change when no places found"
21
+ "--no-cache ": "disable the cache"
22
22
  }
package/lib/cli/index.js CHANGED
@@ -76,7 +76,7 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
76
76
  'help',
77
77
  'fix',
78
78
  'fresh',
79
- 'force',
79
+ 'soft',
80
80
  'raw',
81
81
  'enable-all',
82
82
  'disable-all',
@@ -113,7 +113,7 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
113
113
  disableAll: false,
114
114
  enableAll: false,
115
115
  plugins: [],
116
- force: true,
116
+ soft: false,
117
117
  },
118
118
  };
119
119
 
@@ -126,7 +126,7 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
126
126
 
127
127
  const {
128
128
  fix,
129
- force,
129
+ soft,
130
130
  fixCount,
131
131
  raw,
132
132
  rulesdir,
@@ -279,7 +279,7 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile})
279
279
 
280
280
  const options = {
281
281
  fix,
282
- force,
282
+ soft,
283
283
  isFlow,
284
284
  fixCount,
285
285
  raw,
@@ -16,13 +16,13 @@ const getMatchedOptions = (name, options) => {
16
16
  return merge(options, parseMatch(name, options.match));
17
17
  };
18
18
 
19
- module.exports = ({fix, force, fixCount, isFlow, logError, raw, printer}) => async ({name, source, startLine, options}) => {
19
+ module.exports = ({fix, soft, 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
- force,
25
+ soft,
26
26
  fixCount,
27
27
  isTS,
28
28
  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, force, processFile, processorRunners, fileCache, name, count}) => {
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}) => {
30
30
  const resolvedName = resolve(name).replace(/^\./, cwd);
31
31
 
32
32
  const [configError, options] = tryCatch(getOptions, {
@@ -69,7 +69,7 @@ module.exports = async ({readFile, report, writeFile, exit, raw, write, log, cur
69
69
  raw,
70
70
  dir,
71
71
  fix,
72
- force,
72
+ soft,
73
73
  options,
74
74
  processorRunners,
75
75
  log,
package/lib/putout.js CHANGED
@@ -25,7 +25,7 @@ const defaultOpts = (opts = {}) => {
25
25
  fixCount = 2,
26
26
  loadPlugins = loader.loadPlugins,
27
27
  runPlugins = runner.runPlugins,
28
- force = true,
28
+ soft = false,
29
29
  } = opts;
30
30
 
31
31
  return {
@@ -33,7 +33,7 @@ const defaultOpts = (opts = {}) => {
33
33
  parser,
34
34
  printer,
35
35
  fix,
36
- force,
36
+ soft,
37
37
  fixCount,
38
38
  loadPlugins,
39
39
  runPlugins,
@@ -52,7 +52,7 @@ module.exports = (source, opts) => {
52
52
  sourceFileName,
53
53
  sourceMapName,
54
54
  printer,
55
- force,
55
+ soft,
56
56
  } = opts;
57
57
 
58
58
  const [clearSource, shebang] = cutShebang(source);
@@ -68,7 +68,7 @@ module.exports = (source, opts) => {
68
68
 
69
69
  const places = transform(ast, source, opts);
70
70
 
71
- if (!places.length && !force)
71
+ if (!places.length && soft)
72
72
  return {
73
73
  code: source,
74
74
  places: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "30.1.0",
3
+ "version": "30.2.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, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
@@ -118,7 +118,7 @@
118
118
  "@putout/plugin-npmignore": "^2.0.0",
119
119
  "@putout/plugin-package-json": "^5.0.0",
120
120
  "@putout/plugin-promises": "^11.0.0",
121
- "@putout/plugin-putout": "^12.0.0",
121
+ "@putout/plugin-putout": "^13.0.0",
122
122
  "@putout/plugin-putout-config": "^3.0.0",
123
123
  "@putout/plugin-regexp": "^7.0.0",
124
124
  "@putout/plugin-remove-console": "^6.0.0",
@@ -131,7 +131,7 @@
131
131
  "@putout/plugin-remove-nested-blocks": "^6.0.0",
132
132
  "@putout/plugin-remove-unreachable-code": "^1.0.0",
133
133
  "@putout/plugin-remove-unreferenced-variables": "^2.0.0",
134
- "@putout/plugin-remove-unused-expressions": "^6.0.0",
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",
137
137
  "@putout/plugin-remove-unused-variables": "^5.0.0",
@@ -157,7 +157,7 @@
157
157
  "@putout/plugin-simplify-ternary": "^5.0.1",
158
158
  "@putout/plugin-split-nested-destructuring": "^3.0.0",
159
159
  "@putout/plugin-split-variable-declarations": "^3.0.0",
160
- "@putout/plugin-strict-mode": "^6.0.0",
160
+ "@putout/plugin-strict-mode": "^7.0.0",
161
161
  "@putout/plugin-tape": "^11.0.0",
162
162
  "@putout/plugin-try-catch": "^2.0.0",
163
163
  "@putout/plugin-types": "^1.1.0",