eslint-plugin-putout 19.2.0 → 19.3.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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {findPlacesAsync} from 'putout';
|
|
2
|
+
import tryToCatch from 'try-to-catch';
|
|
3
|
+
import {runAsWorker} from 'synckit';
|
|
4
|
+
import parseOptions from 'putout/parse-options';
|
|
5
|
+
|
|
6
|
+
runAsWorker(async ({name, options, ast, text}) => {
|
|
7
|
+
const resultOptions = parseOptions({
|
|
8
|
+
name,
|
|
9
|
+
options,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
return await tryToCatch(findPlacesAsync, ast, text, resultOptions);
|
|
13
|
+
});
|
|
@@ -14,8 +14,8 @@ const {parseError} = require('../parse-error');
|
|
|
14
14
|
|
|
15
15
|
const cwd = process.cwd();
|
|
16
16
|
|
|
17
|
-
const findPlacesSync = createSyncFn(require.resolve('./find-places'));
|
|
18
|
-
const transformSync = createSyncFn(require.resolve('./transform'));
|
|
17
|
+
const findPlacesSync = createSyncFn(require.resolve('./find-places.mjs'));
|
|
18
|
+
const transformSync = createSyncFn(require.resolve('./transform.mjs'));
|
|
19
19
|
|
|
20
20
|
const EMPTY_VISITORS = {};
|
|
21
21
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {transformAsync} from 'putout';
|
|
2
|
+
import {runAsWorker} from 'synckit';
|
|
3
|
+
import parseOptions from 'putout/parse-options';
|
|
4
|
+
|
|
5
|
+
runAsWorker(async ({name, options, ast, text}) => {
|
|
6
|
+
const resultOptions = parseOptions({
|
|
7
|
+
name,
|
|
8
|
+
options,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
await transformAsync(ast, text, resultOptions);
|
|
12
|
+
|
|
13
|
+
return ast;
|
|
14
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-putout",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.3.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "ESLint plugin for 🐊Putout",
|
|
6
6
|
"release": false,
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"parse-import-specifiers": "^1.0.1",
|
|
53
53
|
"synckit": "^0.8.5",
|
|
54
54
|
"try-catch": "^3.0.0",
|
|
55
|
+
"try-to-catch": "^3.0.1",
|
|
55
56
|
"typescript": "^5.0.4"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
@@ -65,8 +66,7 @@
|
|
|
65
66
|
"mocha": "^10.0.0",
|
|
66
67
|
"montag": "^1.0.0",
|
|
67
68
|
"simport": "^1.2.0",
|
|
68
|
-
"supertape": "^8.0.0"
|
|
69
|
-
"try-to-catch": "^3.0.0"
|
|
69
|
+
"supertape": "^8.0.0"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=16"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const {findPlaces} = require('putout');
|
|
4
|
-
|
|
5
|
-
const tryCatch = require('try-catch');
|
|
6
|
-
const {runAsWorker} = require('synckit');
|
|
7
|
-
const parseOptions = require('putout/parse-options');
|
|
8
|
-
|
|
9
|
-
runAsWorker(({name, options, ast, text}) => {
|
|
10
|
-
const resultOptions = parseOptions({
|
|
11
|
-
name,
|
|
12
|
-
options,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return tryCatch(findPlaces, ast, text, resultOptions);
|
|
16
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const {transform, print} = require('putout');
|
|
4
|
-
|
|
5
|
-
const {runAsWorker} = require('synckit');
|
|
6
|
-
const parseOptions = require('putout/parse-options');
|
|
7
|
-
|
|
8
|
-
runAsWorker(({name, options, ast}) => {
|
|
9
|
-
const resultOptions = parseOptions({
|
|
10
|
-
name,
|
|
11
|
-
options,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
const places = transform(ast, text, {
|
|
16
|
-
rules: updatedRules,
|
|
17
|
-
plugins: parsePlugins(rules),
|
|
18
|
-
});
|
|
19
|
-
*/
|
|
20
|
-
/*
|
|
21
|
-
const places = transform(ast, text, {
|
|
22
|
-
rules: updatedRules,
|
|
23
|
-
plugins: parsePlugins(rules),
|
|
24
|
-
});
|
|
25
|
-
*/
|
|
26
|
-
// if (!places.length)
|
|
27
|
-
transform(ast, print(ast), resultOptions);
|
|
28
|
-
|
|
29
|
-
return ast;
|
|
30
|
-
});
|