@putout/engine-runner 28.0.3 → 28.1.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/README.md +2 -2
- package/lib/merge-visitors.js +4 -1
- package/lib/run-fix.js +6 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ export const replace = () => ({
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
// optional
|
|
56
|
-
export const filter = (path) => {
|
|
56
|
+
export const filter = (path, {options}) => {
|
|
57
57
|
return true;
|
|
58
58
|
};
|
|
59
59
|
|
|
@@ -162,7 +162,7 @@ export const include = () => ['debugger'];
|
|
|
162
162
|
export const exclude = () => {};
|
|
163
163
|
|
|
164
164
|
// optional
|
|
165
|
-
export const filter = (path) => {
|
|
165
|
+
export const filter = (path, {options}) => {
|
|
166
166
|
return true;
|
|
167
167
|
};
|
|
168
168
|
```
|
package/lib/merge-visitors.js
CHANGED
|
@@ -97,7 +97,10 @@ function getStore(plugin, {fix, rule, msg, options}) {
|
|
|
97
97
|
|
|
98
98
|
const push = (path, pathOptions) => {
|
|
99
99
|
const position = getPosition(path);
|
|
100
|
-
const message = msg || plugin.report(path,
|
|
100
|
+
const message = msg || plugin.report(path, {
|
|
101
|
+
options,
|
|
102
|
+
...pathOptions,
|
|
103
|
+
});
|
|
101
104
|
|
|
102
105
|
placesStore({
|
|
103
106
|
message,
|
package/lib/run-fix.js
CHANGED
|
@@ -7,21 +7,12 @@ const isFn = (a) => typeof a === 'function';
|
|
|
7
7
|
const getPath = (path) => path.path || path;
|
|
8
8
|
const debug = createDebug('putout:runner:fix');
|
|
9
9
|
|
|
10
|
-
const chooseFixArgs = ({path, pathOptions, options}) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
return [
|
|
20
|
-
path, {
|
|
21
|
-
options,
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
|
-
};
|
|
10
|
+
const chooseFixArgs = ({path, pathOptions, options}) => [
|
|
11
|
+
path, {
|
|
12
|
+
options,
|
|
13
|
+
...pathOptions,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
25
16
|
|
|
26
17
|
const tryToFix = (fix, {path, pathOptions, position, options}) => {
|
|
27
18
|
const [e] = tryCatch(fix, ...chooseFixArgs({
|