Skip to content

Commit 3ce9cd0

Browse files
committed
feature: @putout/plugin-printer: apply-types: traverse: exclude
1 parent 77b37e3 commit 3ce9cd0

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const {traverse} = require('@putout/babel');

packages/plugin-printer/lib/apply-types/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ module.exports.match = () => ({
2121
}
2222

2323
const [first] = properties;
24+
const {name} = first.value;
2425

25-
return TYPES.includes(first.value.name);
26+
if (name === 'traverse')
27+
return false;
28+
29+
return TYPES.includes(name);
2630
},
2731
});
2832

packages/plugin-printer/lib/apply-types/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ test('printer: apply-types: no report: no pattern', (t) => {
3232
t.end();
3333
});
3434

35+
test('printer: apply-types: no report: traverse', (t) => {
36+
t.noReport('traverse');
37+
t.end();
38+
});
39+
3540
test('printer: apply-types: no report after transform: declare-before-reference', (t) => {
3641
t.noReportAfterTransform('declare-before-reference', {
3742
'apply-types': plugin,

0 commit comments

Comments
 (0)