Merge pull request #604 from dolanmiu/feat/prettier-update

Update tslint to v6
This commit is contained in:
Dolan
2020-08-01 18:04:47 +01:00
committed by GitHub
12 changed files with 65 additions and 35 deletions

57
package-lock.json generated
View File

@ -5,12 +5,12 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@babel/code-frame": { "@babel/code-frame": {
"version": "7.0.0", "version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
"integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/highlight": "^7.0.0" "@babel/highlight": "^7.10.4"
} }
}, },
"@babel/core": { "@babel/core": {
@ -246,13 +246,13 @@
} }
}, },
"@babel/highlight": { "@babel/highlight": {
"version": "7.5.0", "version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.10.4",
"chalk": "^2.0.0", "chalk": "^2.0.0",
"esutils": "^2.0.2",
"js-tokens": "^4.0.0" "js-tokens": "^4.0.0"
}, },
"dependencies": { "dependencies": {
@ -7946,30 +7946,53 @@
} }
}, },
"tslib": { "tslib": {
"version": "1.10.0", "version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==",
"dev": true "dev": true
}, },
"tslint": { "tslint": {
"version": "5.18.0", "version": "6.1.3",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz",
"integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
"builtin-modules": "^1.1.1", "builtin-modules": "^1.1.1",
"chalk": "^2.3.0", "chalk": "^2.3.0",
"commander": "^2.12.1", "commander": "^2.12.1",
"diff": "^3.2.0", "diff": "^4.0.1",
"glob": "^7.1.1", "glob": "^7.1.1",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.3",
"resolve": "^1.3.2", "resolve": "^1.3.2",
"semver": "^5.3.0", "semver": "^5.3.0",
"tslib": "^1.8.0", "tslib": "^1.13.0",
"tsutils": "^2.29.0" "tsutils": "^2.29.0"
},
"dependencies": {
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
"dev": true
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
}
} }
}, },
"tslint-immutable": { "tslint-immutable": {

View File

@ -88,7 +88,7 @@
"shelljs": "^0.8.4", "shelljs": "^0.8.4",
"sinon": "^9.0.2", "sinon": "^9.0.2",
"ts-node": "^8.10.2", "ts-node": "^8.10.2",
"tslint": "^5.11.0", "tslint": "^6.1.3",
"tslint-immutable": "^4.9.0", "tslint-immutable": "^4.9.0",
"typedoc": "^0.16.11", "typedoc": "^0.16.11",
"typescript": "2.9.2", "typescript": "2.9.2",

View File

@ -41,7 +41,7 @@ export interface ISectionOptions {
readonly size?: IPageSizeAttributes; readonly size?: IPageSizeAttributes;
readonly margins?: IPageMarginAttributes; readonly margins?: IPageMarginAttributes;
readonly properties?: SectionPropertiesOptions; readonly properties?: SectionPropertiesOptions;
readonly children: Array<Paragraph | Table | TableOfContents | HyperlinkRef>; readonly children: (Paragraph | Table | TableOfContents | HyperlinkRef)[];
} }
export class File { export class File {

View File

@ -2,7 +2,7 @@ import { Paragraph } from "./paragraph";
import { Table } from "./table"; import { Table } from "./table";
export interface IHeaderOptions { export interface IHeaderOptions {
readonly children: Array<Paragraph | Table>; readonly children: (Paragraph | Table)[];
} }
export class Header { export class Header {

View File

@ -8,10 +8,10 @@ import { ILevelsOptions } from "./level";
import { ConcreteNumbering } from "./num"; import { ConcreteNumbering } from "./num";
export interface INumberingOptions { export interface INumberingOptions {
readonly config: Array<{ readonly config: {
readonly levels: ILevelsOptions[]; readonly levels: ILevelsOptions[];
readonly reference: string; readonly reference: string;
}>; }[];
} }
export class Numbering extends XmlComponent { export class Numbering extends XmlComponent {

View File

@ -10,9 +10,16 @@ import { PictureRun, Run, SequentialIdentifier, SymbolRun, TextRun } from "./run
export interface IParagraphOptions extends IParagraphPropertiesOptions { export interface IParagraphOptions extends IParagraphPropertiesOptions {
readonly text?: string; readonly text?: string;
readonly children?: Array< readonly children?: (
TextRun | PictureRun | SymbolRun | Bookmark | PageBreak | SequentialIdentifier | FootnoteReferenceRun | HyperlinkRef | TextRun
>; | PictureRun
| SymbolRun
| Bookmark
| PageBreak
| SequentialIdentifier
| FootnoteReferenceRun
| HyperlinkRef
)[];
} }
export class Paragraph extends XmlComponent { export class Paragraph extends XmlComponent {

View File

@ -30,11 +30,11 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp
readonly heading?: HeadingLevel; readonly heading?: HeadingLevel;
readonly bidirectional?: boolean; readonly bidirectional?: boolean;
readonly pageBreakBefore?: boolean; readonly pageBreakBefore?: boolean;
readonly tabStops?: Array<{ readonly tabStops?: {
readonly position: number | TabStopPosition; readonly position: number | TabStopPosition;
readonly type: TabStopType; readonly type: TabStopType;
readonly leader?: LeaderType; readonly leader?: LeaderType;
}>; }[];
readonly style?: string; readonly style?: string;
readonly bullet?: { readonly bullet?: {
readonly level: number; readonly level: number;

View File

@ -10,7 +10,7 @@ import { IRunPropertiesOptions, RunProperties } from "./properties";
import { Text } from "./run-components/text"; import { Text } from "./run-components/text";
export interface IRunOptions extends IRunPropertiesOptions { 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; readonly text?: string;
} }

View File

@ -9,7 +9,7 @@ export interface IStylesOptions {
readonly initialStyles?: BaseXmlComponent; readonly initialStyles?: BaseXmlComponent;
readonly paragraphStyles?: IParagraphStyleOptions[]; readonly paragraphStyles?: IParagraphStyleOptions[];
readonly characterStyles?: ICharacterStyleOptions[]; readonly characterStyles?: ICharacterStyleOptions[];
readonly importedStyles?: Array<XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent>; readonly importedStyles?: (XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent)[];
} }
export class Styles extends XmlComponent { export class Styles extends XmlComponent {

View File

@ -44,7 +44,7 @@ export interface ITableCellOptions {
readonly color: string; readonly color: string;
}; };
}; };
readonly children: Array<Paragraph | Table>; readonly children: (Paragraph | Table)[];
} }
export class TableCell extends XmlComponent { export class TableCell extends XmlComponent {

View File

@ -6,7 +6,7 @@ export const EMPTY_OBJECT = Object.seal({});
export abstract class XmlComponent extends BaseXmlComponent { export abstract class XmlComponent extends BaseXmlComponent {
// tslint:disable-next-line:readonly-keyword no-any // tslint:disable-next-line:readonly-keyword no-any
protected root: Array<BaseXmlComponent | string | any>; protected root: (BaseXmlComponent | string | any)[];
constructor(rootKey: string) { constructor(rootKey: string) {
super(rootKey); super(rootKey);

View File

@ -17,8 +17,8 @@ const schemeToType = {
}; };
interface IDocumentRefs { interface IDocumentRefs {
readonly headers: Array<{ readonly id: number; readonly type: HeaderReferenceType }>; readonly headers: { readonly id: number; readonly type: HeaderReferenceType }[];
readonly footers: Array<{ readonly id: number; readonly type: FooterReferenceType }>; readonly footers: { readonly id: number; readonly type: FooterReferenceType }[];
} }
enum RelationshipType { enum RelationshipType {
@ -99,7 +99,7 @@ export class ImportDotx {
return { type: reference.type, footer: wrapper }; return { type: reference.type, footer: wrapper };
}) })
.filter((x) => !!x) as Array<Promise<IDocumentFooter>>; .filter((x) => !!x) as Promise<IDocumentFooter>[];
return Promise.all(result); return Promise.all(result);
} }
@ -134,7 +134,7 @@ export class ImportDotx {
return { type: reference.type, header: wrapper }; return { type: reference.type, header: wrapper };
}) })
.filter((x) => !!x) as Array<Promise<IDocumentHeader>>; .filter((x) => !!x) as Promise<IDocumentHeader>[];
return Promise.all(result); return Promise.all(result);
} }