Skip to content

Commit e98e97d

Browse files
committed
feature: @putout/plugin-printer: merge-tuples-of-type-checkers: Function: exclude
1 parent bea8e67 commit e98e97d

5 files changed

Lines changed: 20 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export const fix = (path) => {
2020
};
2121

2222
export const filter = (path) => {
23-
return compareAny(next(path), ['indent()', 'print.indent()', 'write.indent()']);
23+
return compareAny(next(path), [
24+
'indent()',
25+
'print.indent()',
26+
'write.indent()',
27+
]);
2428
};
2529

2630
export const include = () => [

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export const include = () => [
2525
];
2626

2727
export const filter = (path) => {
28-
return compareAny(prev(path), ['indent()', 'print.indent()', 'write.indent()']);
28+
return compareAny(prev(path), [
29+
'indent()',
30+
'print.indent()',
31+
'write.indent()',
32+
]);
2933
};
3034

3135
function choose(path) {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const isCallInsideArrow = createTypeChecker([
2+
['-: parentPath.parentPath', isFunction],
3+
['+: node.elements.length', '<', 4],
4+
]);

packages/plugin-printer/lib/merge-tuples-of-type-checkers/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ test('printer: merge-tuples-of-type-checkers: no report: is', (t) => {
4141
t.noReport('is');
4242
t.end();
4343
});
44+
45+
test('printer: merge-tuples-of-type-checkers: no report: function', (t) => {
46+
t.noReport('function');
47+
t.end();
48+
});

packages/plugin-printer/lib/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const TYPES_EXISTS = new Set([
88

99
const TYPES_NOT_EXISTS = new Set([
1010
'ExportDeclaration',
11+
'Function',
1112
]);
1213

1314
export function isTypeExists(type) {

0 commit comments

Comments
 (0)