putout 41.17.0 → 41.18.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 +17 -0
- package/README.md +1 -1
- package/bin/communication.js +6 -6
- package/bin/tracer.js +2 -0
- package/package.json +3 -3
- package/putout.json +1 -0
- package/lib/loader/loader.js +0 -48
- package/lib/loader/register.js +0 -3
package/ChangeLog
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
2026.02.05, v41.18.1
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- d7b6677ac putout: remove loader: do not works as expected
|
|
5
|
+
|
|
6
|
+
2026.02.05, v41.18.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- deeb07110 putout: @putout/plugin-remove-useless-map v3.0.0
|
|
10
|
+
- 0e289d049 @putout/plugin-remove-useless-object-from-entries: add
|
|
11
|
+
- 80b9f708a @putout/plugin-remove-useless-map: entries
|
|
12
|
+
- 90a189615 @putout/plugin-remove-useless-map: drop support of 🐊 < 41
|
|
13
|
+
- 1c8879ff4 @putout/plugin-math: apply-numeric-sperators: report
|
|
14
|
+
- 4777adc7c @putout/plugin-putout: replace-test-message: report with options -> transform with options
|
|
15
|
+
- 23abe0f63 @putout/plugin-regexp: apply-character-class: with optimize
|
|
16
|
+
- 8458c2585 @putout/plugin-putout-config: apply-esm: remove add-index-to-import
|
|
17
|
+
|
|
1
18
|
2026.02.03, v41.17.0
|
|
2
19
|
|
|
3
20
|
fix:
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Check out couple variants of plugins that does the same: [**linting debugger sta
|
|
|
42
42
|
```js
|
|
43
43
|
'use strict';
|
|
44
44
|
|
|
45
|
-
module.exports.report = () => '
|
|
45
|
+
module.exports.report = () => `Avoid 'debugger' statement`;
|
|
46
46
|
|
|
47
47
|
module.exports.replace = () => ({
|
|
48
48
|
debugger: '',
|
package/bin/communication.js
CHANGED
|
@@ -15,15 +15,11 @@ export const createCommunication = () => {
|
|
|
15
15
|
const newParentPort = new EventEmitter();
|
|
16
16
|
|
|
17
17
|
assign(newWorker, {
|
|
18
|
-
postMessage: (
|
|
19
|
-
newParentPort.emit('message', a);
|
|
20
|
-
},
|
|
18
|
+
postMessage: createPostMessage(newParentPort),
|
|
21
19
|
});
|
|
22
20
|
|
|
23
21
|
assign(newParentPort, {
|
|
24
|
-
postMessage: (
|
|
25
|
-
newWorker.emit('message', a);
|
|
26
|
-
},
|
|
22
|
+
postMessage: createPostMessage(newWorker),
|
|
27
23
|
});
|
|
28
24
|
|
|
29
25
|
return {
|
|
@@ -32,3 +28,7 @@ export const createCommunication = () => {
|
|
|
32
28
|
workerData: process.argv,
|
|
33
29
|
};
|
|
34
30
|
};
|
|
31
|
+
|
|
32
|
+
export const createPostMessage = (emitter) => (a) => {
|
|
33
|
+
emitter.emit('message', a);
|
|
34
|
+
};
|
package/bin/tracer.js
CHANGED
|
@@ -14,10 +14,12 @@ import {dropInteractive} from './drop-interactive.js';
|
|
|
14
14
|
const args = parseArgs(process.argv.slice(2));
|
|
15
15
|
const write = stdout.write.bind(stdout);
|
|
16
16
|
|
|
17
|
+
/* c8 ignore start */
|
|
17
18
|
if (!args.worker) {
|
|
18
19
|
await import('./putout.js');
|
|
19
20
|
halt();
|
|
20
21
|
}
|
|
22
|
+
/* c8 ignore end */
|
|
21
23
|
|
|
22
24
|
const slave = new URL('./putout.js', import.meta.url);
|
|
23
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "putout",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.18.1",
|
|
4
4
|
"type": "module",
|
|
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",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"./lint/json": "./lib/lint/json.js",
|
|
20
20
|
"./transform": "./lib/transform.js",
|
|
21
21
|
"./find-places": "./lib/find-places.js",
|
|
22
|
-
"./register": "./lib/loader/register.js",
|
|
23
22
|
"./ignores": "./lib/ignores.js",
|
|
24
23
|
"./simple-import": "./lib/cli/simple-import.js"
|
|
25
24
|
},
|
|
@@ -156,7 +155,8 @@
|
|
|
156
155
|
"@putout/plugin-remove-useless-delete": "^2.0.0",
|
|
157
156
|
"@putout/plugin-remove-useless-escape": "^9.0.0",
|
|
158
157
|
"@putout/plugin-remove-useless-functions": "^5.0.0",
|
|
159
|
-
"@putout/plugin-remove-useless-map": "^
|
|
158
|
+
"@putout/plugin-remove-useless-map": "^3.0.0",
|
|
159
|
+
"@putout/plugin-remove-useless-object-from-entries": "^1.0.0",
|
|
160
160
|
"@putout/plugin-remove-useless-operand": "^3.0.0",
|
|
161
161
|
"@putout/plugin-remove-useless-push": "^2.0.0",
|
|
162
162
|
"@putout/plugin-remove-useless-replace": "^2.0.0",
|
package/putout.json
CHANGED
package/lib/loader/loader.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import process from 'node:process';
|
|
2
|
-
import {Buffer} from 'node:buffer';
|
|
3
|
-
import {parseOptions} from '#parse-options';
|
|
4
|
-
import {putoutAsync} from '../putout.js';
|
|
5
|
-
import {ignores} from '../ignores.js';
|
|
6
|
-
|
|
7
|
-
const cwd = process.cwd();
|
|
8
|
-
|
|
9
|
-
const toLoad = (transformSource) => async (url, context, nextLoad) => {
|
|
10
|
-
const {format, source: rawSource} = await nextLoad(url, context);
|
|
11
|
-
|
|
12
|
-
if (format !== 'module')
|
|
13
|
-
return nextLoad(url);
|
|
14
|
-
|
|
15
|
-
const {source} = await transformSource(rawSource, {
|
|
16
|
-
url,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
format: 'module',
|
|
21
|
-
source,
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const transformSource = async (source, context) => {
|
|
26
|
-
const {url} = context;
|
|
27
|
-
const name = url.replace('file://', '');
|
|
28
|
-
|
|
29
|
-
const options = parseOptions({
|
|
30
|
-
name,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
if (ignores(cwd, name, options))
|
|
34
|
-
return {
|
|
35
|
-
source,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const {code} = await putoutAsync(String(source), {
|
|
39
|
-
printer: 'putout',
|
|
40
|
-
...options,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
source: Buffer.from(code),
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const load = toLoad(transformSource);
|
package/lib/loader/register.js
DELETED