Skip to content

Commit b8e0274

Browse files
committed
feature: @putout/plugin-putout: declare-template-variables: ArrowFunction body: expression
1 parent 29545d3 commit b8e0274

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const match = () => ({
2+
'const __a = __b': ({__b, __a}) => isIdentifier(__a),
3+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const match = () => ({
2+
'const __a = __b': ({__b}) => isIdentifier(__a),
3+
});
4+

packages/plugin-putout/lib/declare-template-variables/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const fix = ({path, node}) => {
2929
};
3030

3131
export const traverse = ({push}) => ({
32-
'(__a, path) => __body': process(push),
33-
'(__a) => __body': process(push),
32+
'(__a, path) => __b': process(push),
33+
'(__a) => __b': process(push),
3434
});
3535

3636
const process = (push) => (path) => {

packages/plugin-putout/lib/declare-template-variables/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ test('putout: declare-template-variables: transform: one', (t) => {
2727
t.end();
2828
});
2929

30+
test('putout: declare-template-variables: transform: arrow-body', (t) => {
31+
t.transform('arrow-body');
32+
t.end();
33+
});
34+
3035
test('putout: declare-template-variables: no report: declared', (t) => {
3136
t.noReport('declared');
3237
t.end();

0 commit comments

Comments
 (0)