Skip to content

Commit 9eb0288

Browse files
committed
feature: @putout/plugin-putout: declare: addParens, removeParens
1 parent f6e8260 commit 9eb0288

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,23 @@ test('plugin-putout: declare: transform: operator-keyword', (t) => {
394394
t.transform('operator-keyword');
395395
t.end();
396396
});
397+
398+
test('plugin-putout: declare: transform: addParens', (t) => {
399+
t.transformCode(`addParens(path);`, montag`
400+
import {operator} from 'putout';
401+
402+
const {addParens} = operator;
403+
addParens(path);\n
404+
`);
405+
t.end();
406+
});
407+
408+
test('plugin-putout: declare: transform: removeParens', (t) => {
409+
t.transformCode(`removeParens(path);`, montag`
410+
import {operator} from 'putout';
411+
412+
const {removeParens} = operator;
413+
removeParens(path);\n
414+
`);
415+
t.end();
416+
});

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ module.exports = {
4040
setLiteralValue: 'const {setLiteralValue} = operator',
4141
matchFiles: 'const {matchFiles} = operator',
4242
ignore: 'const {ignore} = operator',
43+
addParens: 'const {addParens} = operator',
44+
removeParens: 'const {removeParens} = operator',
4345
};

0 commit comments

Comments
 (0)