Skip to content

Commit fb80d03

Browse files
committed
feature: @putout/plugin-putout: declare: jsx: addAttributeValue
1 parent 3845163 commit fb80d03

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/plugin-putout/lib/declare/jsx.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,14 @@ test('plugin-putout: declare: transform: jsx: getAttributeValue', (t) => {
5151
`);
5252
t.end();
5353
});
54+
55+
test('plugin-putout: declare: transform: jsx: addAttributeValue', (t) => {
56+
t.transformCode(`addAttributeValue(path, 'className', 'hello')`, montag`
57+
import {operator} from 'putout';
58+
59+
const {addAttributeValue} = operator;
60+
addAttributeValue(path, 'className', 'hello');
61+
62+
`);
63+
t.end();
64+
});

packages/plugin-putout/lib/declare/operator/jsx.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export default {
33
getAttributePath: 'const {getAttributePath} = operator',
44
getAttributeNode: 'const {getAttributeNode} = operator',
55
getAttributeValue: 'const {getAttributeValue} = operator',
6+
addAttributeValue: 'const {addAttributeValue} = operator',
67
};

0 commit comments

Comments
 (0)