Skip to content

Commit 4842533

Browse files
committed
chore: @putout/processor-wasm: use @putout/printer
1 parent b57c92b commit 4842533

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

packages/processor-wasm/.madrun.js

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ export default {
1010
'coverage': async () => `c8 ${await run('test')}`,
1111
'report': () => 'c8 report --reporter=lcov',
1212
};
13-

packages/processor-wasm/.putout.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printer": "putout"
3+
}

packages/processor-wasm/lib/lint.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import tryCatch from 'try-catch';
2-
32
import {traverse} from '@webassemblyjs/ast';
43
import {parse} from '@webassemblyjs/wast-parser';
54
import {print} from '@webassemblyjs/wast-printer';
6-
75
import {rules} from './rules/index.js';
86

97
export const lint = (source, {fix} = {}) => {
@@ -22,7 +20,9 @@ export const lint = (source, {fix} = {}) => {
2220
const places = [];
2321
const push = places.push.bind(places);
2422

25-
traverse(ast, plugin.traverse({push}));
23+
traverse(ast, plugin.traverse({
24+
push,
25+
}));
2626

2727
if (!places.length)
2828
continue;
@@ -58,7 +58,10 @@ function convertPlaces(rule, rawPlaces, plugin) {
5858
const places = [];
5959

6060
for (const path of rawPlaces) {
61-
const {line, column} = path.node.loc.start;
61+
const {
62+
line,
63+
column,
64+
} = path.node.loc.start;
6265

6366
places.push({
6467
rule: `${rule} (wasm)`,

packages/processor-wasm/lib/rules/convert-get-local-to-local-get.js

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ export const traverse = ({push}) => ({
1111
push(path);
1212
},
1313
});
14-

packages/processor-wasm/lib/rules/convert-set-local-to-local-set.js

-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ export const traverse = ({push}) => ({
1212
}
1313
},
1414
});
15-

packages/processor-wasm/lib/wasm.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ export const fix = (source) => {
1818

1919
return code;
2020
};
21-

packages/processor-wasm/test/wasm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {createTest} from '@putout/test/processor';
2+
23
const test = createTest(import.meta.url, {
34
processors: [
45
'wasm',
@@ -63,4 +64,3 @@ test('putout: processor: wasm: places: get-local', async ({comparePlaces}) => {
6364
rule: 'convert-get-local-to-local-get (wasm)',
6465
}]);
6566
});
66-

0 commit comments

Comments
 (0)