Skip to content

Commit 7e6e58c

Browse files
Make entire option object optional
1 parent 17b386c commit 7e6e58c

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/lib/talonFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Options {
88
readonly columnWidth?: number;
99
}
1010

11-
export function talonFormatter(node: Node, options: Options): string {
11+
export function talonFormatter(node: Node, options: Options = {}): string {
1212
const columnWidth = getColumnWidth(node.text) ?? options.columnWidth;
1313
const indentation = getIndentation(options.indentTabs, options.indentWidth);
1414
const formatter = new TalonFormatter(indentation, columnWidth);

src/lib/talonListFormatter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ interface Options {
55
readonly columnWidth?: number;
66
}
77

8-
export function talonListFormatter(text: string, options: Options): string {
8+
export function talonListFormatter(
9+
text: string,
10+
options: Options = {},
11+
): string {
912
const columnWidth = getColumnWidth(text) ?? options.columnWidth;
1013
const talonList = parseTalonList(text);
1114
talonList.headers.sort((a, _b) =>

src/lib/treeSitterFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Options {
66
readonly indentWidth?: number;
77
}
88

9-
export function treeSitterFormatter(node: Node, options: Options): string {
9+
export function treeSitterFormatter(node: Node, options: Options = {}): string {
1010
const indentation = getIndentation(options.indentTabs, options.indentWidth);
1111
const formatter = new TreeSitterFormatter(indentation);
1212
return formatter.getText(node);

0 commit comments

Comments
 (0)