putout 20.16.1 → 20.19.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 CHANGED
@@ -1,3 +1,44 @@
1
+ 2021.10.29, v20.19.1
2
+
3
+ fix:
4
+ - (putout) --help: --match [file name] -> --match [pattern]
5
+
6
+
7
+ 2021.10.28, v20.19.0
8
+
9
+ fix:
10
+ - (@putout/plugin-remove-unused-variables) add support of computed key
11
+
12
+ feature:
13
+ - (package) @putout/processor-yaml v3.0.0
14
+ - (@putout/processor-yaml) drop support of putout < 20
15
+ - (@putout/processor-yaml) js-yaml -> yaml: useless quotes (nodeca/js-yaml#645)
16
+ - (eslint-plugin-putout) safe: disable remove-unused-types
17
+
18
+
19
+ 2021.10.22, v20.18.0
20
+
21
+ feature:
22
+ - (putout) loader: add support of node v16.12 (https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#16.12.0)
23
+ - (@putout/plugin-declare-undefined-variables) add support of stream
24
+ - (@putout/plugin-declare-undefined-variables) add support of module
25
+ - (eslint-plugin-putout) no-unresolved: disable for TS
26
+ - (@putout/plugin-convert-generic-to-shorthand) exclude TSUnionType
27
+
28
+
29
+ 2021.10.21, v20.17.0
30
+
31
+ fix:
32
+ - (@putout/plugin-remove-unused-variables) typescript dts
33
+
34
+ feature:
35
+ - (putout) declare-undefined-variables: disable for *.d.ts
36
+ - (@putout/plugin-convert-typeof-to-is-type) add support of upper scopes
37
+ - (@putout/plugin-convert-typeof-to-is-type) exclude binded values
38
+ - (@putout/plugin-convert-typeof-to-is-type) exclude VariableDeclarator
39
+ - (eslint-plugin-putout) tape-add-newline-before-assertion: add support of test.skip(), test.only()
40
+
41
+
1
42
  2021.10.20, v20.16.1
2
43
 
3
44
  fix:
package/README.md CHANGED
@@ -121,7 +121,7 @@ Options:
121
121
  --disable [rule] disable the rule and save it to '.putout.json' walking up parent directories
122
122
  --enable-all enable all found rules and save them to '.putout.json' walking up parent directories
123
123
  --disable-all disable all found rules (set baseline) and save them '.putout.json' walking up parent directories
124
- --match [file name] read .putout.json and convert 'rules' to 'match' using pattern
124
+ --match [pattern] read .putout.json and convert 'rules' to 'match' according to 'pattern'
125
125
  --flow enable flow
126
126
  --fresh generate a fresh cache
127
127
  --no-config avoid reading '.putout.json'
package/help.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "--disable [rule] ": "disable the rule and save it to '.putout.json' walking up parent directories",
13
13
  "--enable-all ": "enable all found rules and save them to '.putout.json' walking up parent directories",
14
14
  "--disable-all ": "disable all found rules (set baseline) and save them to '.putout.json' walking up parent directories",
15
- "--match [file name] ": "read .putout.json and convert 'rules' to 'match' using pattern",
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
18
  "--no-config ": "avoid reading '.putout.json'",
package/lib/loader.mjs CHANGED
@@ -4,6 +4,24 @@ import parseOptions from './parse-options/index.js';
4
4
 
5
5
  const cwd = process.cwd();
6
6
 
7
+ const toLoad = (transformSource) => async (url, context, defaultLoad) => {
8
+ const {source: rawSource} = await defaultLoad(url, context);
9
+
10
+ if (!rawSource)
11
+ return {
12
+ format: 'commonjs',
13
+ };
14
+
15
+ const {source} = await transformSource(rawSource, {
16
+ url,
17
+ });
18
+
19
+ return {
20
+ source,
21
+ format: 'module',
22
+ };
23
+ };
24
+
7
25
  export const transformSource = (source, context) => {
8
26
  const {url} = context;
9
27
 
@@ -25,3 +43,5 @@ export const transformSource = (source, context) => {
25
43
  };
26
44
  };
27
45
 
46
+ export const load = toLoad(transformSource);
47
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "20.16.1",
3
+ "version": "20.19.1",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "🐊 Pluggable and configurable code transformer with built-in eslint, babel plugins and jscodeshift codemods support of js, jsx typescript, flow files, markdown, yaml and json",
6
6
  "homepage": "http://github.com/coderaiser/putout",
@@ -15,7 +15,7 @@
15
15
  "./process-file": "./lib/cli/process-file.js",
16
16
  "./exit-codes": "./lib/cli/exit-codes.mjs",
17
17
  "./cli": "./lib/cli/index.js",
18
- "./loader": "./lib/loader.js",
18
+ "./loader": "./lib/loader.mjs",
19
19
  "./eslint": "./lib/cli/eslint/index.js",
20
20
  "./package.json": "./package.json"
21
21
  },
@@ -177,7 +177,7 @@
177
177
  "@putout/processor-javascript": "^3.0.0",
178
178
  "@putout/processor-json": "^3.0.0",
179
179
  "@putout/processor-markdown": "^5.0.0",
180
- "@putout/processor-yaml": "^2.0.0",
180
+ "@putout/processor-yaml": "^3.0.0",
181
181
  "@putout/traverse": "^4.0.0",
182
182
  "chalk": "^4.0.0",
183
183
  "ci-info": "^3.1.1",
package/putout.json CHANGED
@@ -94,6 +94,9 @@
94
94
  "remove-useless-mapping-modifiers": "on",
95
95
  "remove-useless-types-from-constants": "on",
96
96
  "remove-unused-types": "on"
97
+ },
98
+ "*.d.ts": {
99
+ "declare-undefined-variables": "off"
97
100
  }
98
101
  },
99
102
  "ignore": [