From 70a3b25d54bc02daf8819d8f246e57f35d13ef5d Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sun, 16 Oct 2022 00:20:16 +0100 Subject: [PATCH] Fix Prettier errors --- .../paragraph/formatting/tab-stop.spec.ts | 4 ++-- src/file/paragraph/formatting/tab-stop.ts | 24 ++++++++++--------- src/file/paragraph/properties.ts | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/file/paragraph/formatting/tab-stop.spec.ts b/src/file/paragraph/formatting/tab-stop.spec.ts index 0c4d04bfec..0d0d86059d 100644 --- a/src/file/paragraph/formatting/tab-stop.spec.ts +++ b/src/file/paragraph/formatting/tab-stop.spec.ts @@ -8,7 +8,7 @@ describe("LeftTabStop", () => { let tabStop: TabStop; beforeEach(() => { - tabStop = new TabStop({ type: TabStopType.LEFT, position: 100}); + tabStop = new TabStop({ type: TabStopType.LEFT, position: 100 }); }); describe("#constructor()", () => { @@ -32,7 +32,7 @@ describe("RightTabStop", () => { let tabStop: TabStop; beforeEach(() => { - tabStop = new TabStop({ type: TabStopType.RIGHT, position: 100, leader: LeaderType.DOT}); + tabStop = new TabStop({ type: TabStopType.RIGHT, position: 100, leader: LeaderType.DOT }); }); describe("#constructor()", () => { diff --git a/src/file/paragraph/formatting/tab-stop.ts b/src/file/paragraph/formatting/tab-stop.ts index 52edf7c2db..3d5d8e412d 100644 --- a/src/file/paragraph/formatting/tab-stop.ts +++ b/src/file/paragraph/formatting/tab-stop.ts @@ -2,21 +2,23 @@ import { XmlAttributeComponent, XmlComponent } from "@file/xml-components"; export interface TabStopDefinition { - type: TabStopType, - position: number | TabStopPosition, - leader?: LeaderType -} + type: TabStopType; + position: number | TabStopPosition; + leader?: LeaderType; +} export class TabStop extends XmlComponent { - public constructor(tabDefs: (TabStopDefinition[] | TabStopDefinition | TabStopType), position?: number, leader?: LeaderType) { + public constructor(tabDefs: TabStopDefinition[] | TabStopDefinition | TabStopType, position?: number, leader?: LeaderType) { super("w:tabs"); - if (typeof tabDefs === "string"){ + if (typeof tabDefs === "string") { this.root.push(new TabStopItem(tabDefs, position, leader)); } else { if (Array.isArray(tabDefs)) { - tabDefs.forEach((function(tabDef) { - this.root.push(new TabStopItem(tabDef)); - }).bind(this)); + tabDefs.forEach( + function (tabDef) { + this.root.push(new TabStopItem(tabDef)); + }.bind(this), + ); } else { this.root.push(new TabStopItem(tabDefs)); } @@ -57,7 +59,7 @@ export class TabAttributes extends XmlAttributeComponent<{ } export class TabStopItem extends XmlComponent { - public constructor(tabDef: (TabStopDefinition | TabStopType), position?: number, leader?: LeaderType) { + public constructor(tabDef: TabStopDefinition | TabStopType, position?: number, leader?: LeaderType) { super("w:tab"); if (typeof tabDef === "string") { if (typeof position === "number") @@ -75,7 +77,7 @@ export class TabStopItem extends XmlComponent { val: tabDef.type, pos: tabDef.position, leader: tabDef.leader, - }) + }), ); } } diff --git a/src/file/paragraph/properties.ts b/src/file/paragraph/properties.ts index 2acbcd2c52..ac6f4dd9dc 100644 --- a/src/file/paragraph/properties.ts +++ b/src/file/paragraph/properties.ts @@ -138,7 +138,7 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent { */ let tabDefs: TabStopDefinition[] = []; if (options.rightTabStop) { - tabDefs.push({ type: TabStopType.RIGHT, position: options.rightTabStop}); + tabDefs.push({ type: TabStopType.RIGHT, position: options.rightTabStop }); } if (options.tabStops) { @@ -153,7 +153,7 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent { this.push(new TabStop(tabDefs)); } /** - * FIX - END + * FIX - END */ if (options.bidirectional !== undefined) {