Skip to content

Commit

Permalink
Merge pull request #604 from dolanmiu/feat/prettier-update
Browse files Browse the repository at this point in the history
Update tslint to v6
  • Loading branch information
dolanmiu authored Aug 1, 2020
2 parents 8c45c30 + d18cfbc commit a6eb8e0
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 35 deletions.
57 changes: 40 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"shelljs": "^0.8.4",
"sinon": "^9.0.2",
"ts-node": "^8.10.2",
"tslint": "^5.11.0",
"tslint": "^6.1.3",
"tslint-immutable": "^4.9.0",
"typedoc": "^0.16.11",
"typescript": "2.9.2",
Expand Down
2 changes: 1 addition & 1 deletion src/file/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface ISectionOptions {
readonly size?: IPageSizeAttributes;
readonly margins?: IPageMarginAttributes;
readonly properties?: SectionPropertiesOptions;
readonly children: Array<Paragraph | Table | TableOfContents | HyperlinkRef>;
readonly children: (Paragraph | Table | TableOfContents | HyperlinkRef)[];
}

export class File {
Expand Down
2 changes: 1 addition & 1 deletion src/file/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Paragraph } from "./paragraph";
import { Table } from "./table";

export interface IHeaderOptions {
readonly children: Array<Paragraph | Table>;
readonly children: (Paragraph | Table)[];
}

export class Header {
Expand Down
4 changes: 2 additions & 2 deletions src/file/numbering/numbering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { ILevelsOptions } from "./level";
import { ConcreteNumbering } from "./num";

export interface INumberingOptions {
readonly config: Array<{
readonly config: {
readonly levels: ILevelsOptions[];
readonly reference: string;
}>;
}[];
}

export class Numbering extends XmlComponent {
Expand Down
13 changes: 10 additions & 3 deletions src/file/paragraph/paragraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ import { PictureRun, Run, SequentialIdentifier, SymbolRun, TextRun } from "./run

export interface IParagraphOptions extends IParagraphPropertiesOptions {
readonly text?: string;
readonly children?: Array<
TextRun | PictureRun | SymbolRun | Bookmark | PageBreak | SequentialIdentifier | FootnoteReferenceRun | HyperlinkRef
>;
readonly children?: (
| TextRun
| PictureRun
| SymbolRun
| Bookmark
| PageBreak
| SequentialIdentifier
| FootnoteReferenceRun
| HyperlinkRef
)[];
}

export class Paragraph extends XmlComponent {
Expand Down
4 changes: 2 additions & 2 deletions src/file/paragraph/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
readonly heading?: HeadingLevel;
readonly bidirectional?: boolean;
readonly pageBreakBefore?: boolean;
readonly tabStops?: Array<{
readonly tabStops?: {
readonly position: number | TabStopPosition;
readonly type: TabStopType;
readonly leader?: LeaderType;
}>;
}[];
readonly style?: string;
readonly bullet?: {
readonly level: number;
Expand Down
2 changes: 1 addition & 1 deletion src/file/paragraph/run/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IRunPropertiesOptions, RunProperties } from "./properties";
import { Text } from "./run-components/text";

export interface IRunOptions extends IRunPropertiesOptions {
readonly children?: Array<Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string>;
readonly children?: (Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string)[];
readonly text?: string;
}

Expand Down
2 changes: 1 addition & 1 deletion src/file/styles/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface IStylesOptions {
readonly initialStyles?: BaseXmlComponent;
readonly paragraphStyles?: IParagraphStyleOptions[];
readonly characterStyles?: ICharacterStyleOptions[];
readonly importedStyles?: Array<XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent>;
readonly importedStyles?: (XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent)[];
}

export class Styles extends XmlComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/file/table/table-cell/table-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface ITableCellOptions {
readonly color: string;
};
};
readonly children: Array<Paragraph | Table>;
readonly children: (Paragraph | Table)[];
}

export class TableCell extends XmlComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/file/xml-components/xml-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const EMPTY_OBJECT = Object.seal({});

export abstract class XmlComponent extends BaseXmlComponent {
// tslint:disable-next-line:readonly-keyword no-any
protected root: Array<BaseXmlComponent | string | any>;
protected root: (BaseXmlComponent | string | any)[];

constructor(rootKey: string) {
super(rootKey);
Expand Down
8 changes: 4 additions & 4 deletions src/import-dotx/import-dotx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const schemeToType = {
};

interface IDocumentRefs {
readonly headers: Array<{ readonly id: number; readonly type: HeaderReferenceType }>;
readonly footers: Array<{ readonly id: number; readonly type: FooterReferenceType }>;
readonly headers: { readonly id: number; readonly type: HeaderReferenceType }[];
readonly footers: { readonly id: number; readonly type: FooterReferenceType }[];
}

enum RelationshipType {
Expand Down Expand Up @@ -99,7 +99,7 @@ export class ImportDotx {

return { type: reference.type, footer: wrapper };
})
.filter((x) => !!x) as Array<Promise<IDocumentFooter>>;
.filter((x) => !!x) as Promise<IDocumentFooter>[];

return Promise.all(result);
}
Expand Down Expand Up @@ -134,7 +134,7 @@ export class ImportDotx {

return { type: reference.type, header: wrapper };
})
.filter((x) => !!x) as Array<Promise<IDocumentHeader>>;
.filter((x) => !!x) as Promise<IDocumentHeader>[];

return Promise.all(result);
}
Expand Down

0 comments on commit a6eb8e0

Please sign in to comment.