putout 26.9.3 → 26.12.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,38 @@
1
+ 2022.06.04, v26.12.0
2
+
3
+ feature:
4
+ - (putout) improve support of processing typescript in markdown
5
+ - (@putout/plugin-typescript) add remove-useless-parens
6
+ - (@putout/plugin-typescript) convert-generic-to-shorthand: report
7
+ - (@putout/plugin-typescript) convert-generic-to-shorthand: improve support of UnionType
8
+ - (eslint-plugin-putout) markdown{ts}: enable @typescript-eslint/array-type
9
+ - (@putout/plugin-simplify-logical-expressions) add cases of duplication operand
10
+ - (@putout/plugin-simplify-logical-expression) report message
11
+
12
+
13
+ 2022.06.02, v26.11.0
14
+
15
+ fix:
16
+ - (putout) resolve name before parsing options
17
+
18
+
19
+ feature:
20
+ - (package) @putout/plugin-simplify-ternary v3.0.0
21
+ - (@putout/plugin-simplify-ternary) drop support of 🐊 < 26
22
+ - (@putout/plugin-simplify-ternary) add support of spread
23
+
24
+
25
+ 2022.06.01, v26.10.0
26
+
27
+ fix:
28
+ - (@putout/cli-cache) canUseCache: no when places.length
29
+
30
+ feature:
31
+ - (putout) process-file: --disalble-all show places found by parsers other then javascript
32
+ - (package) @putout/cli-cache v1.1.0
33
+ - (@putout/cli-cache) drop support of node < 16
34
+ - (@putout/cli-cache) canUseCache: can even if places found
35
+
1
36
  2022.05.31, v26.9.3
2
37
 
3
38
  feature:
@@ -16,7 +16,7 @@ const getMatchedOptions = (name, options) => {
16
16
  return merge(options, parseMatch(name, options.match));
17
17
  };
18
18
 
19
- module.exports = ({fix, fixCount, isFlow, ruler = {}, logError, raw}) => async ({name, source, startLine, options}) => {
19
+ module.exports = ({fix, fixCount, isFlow, logError, raw}) => async ({name, source, startLine, options}) => {
20
20
  const isTS = /\.tsx?$/.test(name) || /{tsx?}$/.test(name);
21
21
  const matchedOptions = getMatchedOptions(name, options);
22
22
 
@@ -35,12 +35,6 @@ module.exports = ({fix, fixCount, isFlow, ruler = {}, logError, raw}) => async (
35
35
  const {code = source} = result || {};
36
36
  const allPlaces = result ? result.places : parseError(e);
37
37
 
38
- if (ruler.disable || ruler.enable || ruler.disableAll || ruler.enableAll)
39
- return {
40
- places: formatPlaces(startLine, allPlaces),
41
- code,
42
- };
43
-
44
38
  const [newCode, newPlaces] = await eslint({
45
39
  name,
46
40
  code,
@@ -37,7 +37,7 @@ module.exports = async ({readFile, report, writeFile, exit, raw, write, log, cur
37
37
  .replace(/^\./, cwd);
38
38
 
39
39
  const [configError, options] = tryCatch(getOptions, {
40
- name,
40
+ name: resolvedName,
41
41
  rulesdir,
42
42
  noConfig,
43
43
  transform,
@@ -48,7 +48,7 @@ module.exports = async ({readFile, report, writeFile, exit, raw, write, log, cur
48
48
  return exit(INVALID_CONFIG, configError);
49
49
 
50
50
  const {dir} = options;
51
- const [success, currentPlaces] = await runCache({
51
+ const success = await runCache({
52
52
  options,
53
53
  fileCache,
54
54
  report,
@@ -63,7 +63,6 @@ module.exports = async ({readFile, report, writeFile, exit, raw, write, log, cur
63
63
 
64
64
  if (success)
65
65
  return {
66
- places: currentPlaces,
67
66
  success,
68
67
  };
69
68
 
@@ -117,7 +116,7 @@ module.exports = async ({readFile, report, writeFile, exit, raw, write, log, cur
117
116
 
118
117
  async function runCache({fileCache, report, write, formatterOptions, currentFormat, name, resolvedName, index, count, options}) {
119
118
  if (!fileCache.canUseCache(name, options))
120
- return [false, []];
119
+ return false;
121
120
 
122
121
  const places = fileCache.getPlaces(name);
123
122
  const formatterProxy = createFormatterProxy({
@@ -133,6 +132,6 @@ async function runCache({fileCache, report, write, formatterOptions, currentForm
133
132
 
134
133
  write(line || '');
135
134
 
136
- return [true, places];
135
+ return true;
137
136
  }
138
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "26.9.3",
3
+ "version": "26.12.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",
@@ -47,7 +47,7 @@
47
47
  "@babel/code-frame": "^7.10.4",
48
48
  "@babel/traverse": "^7.12.5",
49
49
  "@babel/types": "^7.12.6",
50
- "@putout/cli-cache": "^1.0.0",
50
+ "@putout/cli-cache": "^1.1.0",
51
51
  "@putout/cli-keypress": "^1.0.0",
52
52
  "@putout/cli-match": "^1.0.0",
53
53
  "@putout/cli-ruler": "^2.0.0",
@@ -165,7 +165,7 @@
165
165
  "@putout/plugin-reuse-duplicate-init": "^4.0.0",
166
166
  "@putout/plugin-simplify-assignment": "^1.0.0",
167
167
  "@putout/plugin-simplify-logical-expressions": "^2.0.0",
168
- "@putout/plugin-simplify-ternary": "^2.0.0",
168
+ "@putout/plugin-simplify-ternary": "^3.0.0",
169
169
  "@putout/plugin-split-nested-destructuring": "^1.0.0",
170
170
  "@putout/plugin-split-variable-declarations": "^2.0.0",
171
171
  "@putout/plugin-strict-mode": "^5.0.0",
package/putout.json CHANGED
@@ -85,7 +85,7 @@
85
85
  "*.cjs": {
86
86
  "convert-esm-to-commonjs": "on"
87
87
  },
88
- "*.{ts,tsx,mts,cts}": {
88
+ "*.{ts,tsx,mts,cts,md{ts}}": {
89
89
  "typescript": "on"
90
90
  },
91
91
  "*.d.ts": {