diff --git a/src/file/document/body/section-properties/section-properties.spec.ts b/src/file/document/body/section-properties/section-properties.spec.ts index f3a357bc04..14de590e0a 100644 --- a/src/file/document/body/section-properties/section-properties.spec.ts +++ b/src/file/document/body/section-properties/section-properties.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { expect } from "chai"; import { Formatter } from "@export/formatter"; @@ -203,7 +204,7 @@ describe("SectionProperties", () => { }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); - const pgBorders = tree["w:sectPr"].find((item) => item["w:pgBorders"] !== undefined); + const pgBorders = tree["w:sectPr"].find((item: any) => item["w:pgBorders"] !== undefined); expect(pgBorders).to.deep.equal({ "w:pgBorders": { _attr: { "w:offsetFrom": "page" } }, }); @@ -219,7 +220,7 @@ describe("SectionProperties", () => { }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); - const pgNumType = tree["w:sectPr"].find((item) => item["w:pgNumType"] !== undefined); + const pgNumType = tree["w:sectPr"].find((item: any) => item["w:pgNumType"] !== undefined); expect(pgNumType).to.deep.equal({ "w:pgNumType": { _attr: { "w:fmt": "upperRoman" } }, }); @@ -229,7 +230,7 @@ describe("SectionProperties", () => { const properties = new SectionProperties({}); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); - const pgNumType = tree["w:sectPr"].find((item) => item["w:pgNumType"] !== undefined); + const pgNumType = tree["w:sectPr"].find((item: any) => item["w:pgNumType"] !== undefined); expect(pgNumType).to.deep.equal({ "w:pgNumType": { _attr: {} } }); }); @@ -239,7 +240,7 @@ describe("SectionProperties", () => { }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); - const type = tree["w:sectPr"].find((item) => item["w:type"] !== undefined); + const type = tree["w:sectPr"].find((item: any) => item["w:type"] !== undefined); expect(type).to.deep.equal({ "w:type": { _attr: { "w:val": "continuous" } }, }); @@ -256,7 +257,7 @@ describe("SectionProperties", () => { }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); - const type = tree["w:sectPr"].find((item) => item["w:lnNumType"] !== undefined); + const type = tree["w:sectPr"].find((item: any) => item["w:lnNumType"] !== undefined); expect(type).to.deep.equal({ "w:lnNumType": { _attr: { "w:countBy": 2, "w:distance": 4, "w:restart": "continuous", "w:start": 2 } }, }); @@ -270,7 +271,7 @@ describe("SectionProperties", () => { }); const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); - const type = tree["w:sectPr"].find((item) => item["w:textDirection"] !== undefined); + const type = tree["w:sectPr"].find((item: any) => item["w:textDirection"] !== undefined); expect(type).to.deep.equal({ "w:textDirection": { _attr: { "w:val": "tbRl" } }, }); diff --git a/src/file/drawing/drawing.ts b/src/file/drawing/drawing.ts index 4bb83a9462..7040ef341e 100644 --- a/src/file/drawing/drawing.ts +++ b/src/file/drawing/drawing.ts @@ -26,18 +26,16 @@ export interface IDrawingOptions { // export class Drawing extends XmlComponent { - private readonly inline: Inline; - public constructor(imageData: IMediaData, drawingOptions: IDrawingOptions = {}) { super("w:drawing"); if (!drawingOptions.floating) { - this.inline = new Inline({ + const inline = new Inline({ mediaData: imageData, transform: imageData.transformation, docProperties: drawingOptions.docProperties, }); - this.root.push(this.inline); + this.root.push(inline); } else { this.root.push(new Anchor(imageData, imageData.transformation, drawingOptions)); } diff --git a/src/file/numbering/numbering.spec.ts b/src/file/numbering/numbering.spec.ts index 6058023518..13f1b9afe6 100644 --- a/src/file/numbering/numbering.spec.ts +++ b/src/file/numbering/numbering.spec.ts @@ -26,7 +26,7 @@ describe("Numbering", () => { const tree = new Formatter().format(numbering); expect(Object.keys(tree)).to.deep.equal(["w:numbering"]); // eslint-disable-next-line @typescript-eslint/no-explicit-any - const abstractNums: readonly any[] = tree["w:numbering"].filter((el) => el["w:abstractNum"]); + const abstractNums: readonly any[] = tree["w:numbering"].filter((el: any) => el["w:abstractNum"]); expect(abstractNums).to.have.lengthOf(1); expect(abstractNums[0]["w:abstractNum"]).to.deep.include.members([ { _attr: { "w:abstractNumId": 0, "w15:restartNumberingAfterBreak": 0 } }, diff --git a/src/file/styles/styles.spec.ts b/src/file/styles/styles.spec.ts index 8d0c8c7777..4c74861909 100644 --- a/src/file/styles/styles.spec.ts +++ b/src/file/styles/styles.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { expect } from "chai"; import { Formatter } from "@export/formatter"; @@ -15,7 +16,7 @@ describe("Styles", () => { }, ], }); - const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); + const tree = new Formatter().format(styles)["w:styles"].filter((x: any) => !x._attr); expect(tree).to.deep.equal([ { "w:style": { _attr: { "w:type": "paragraph", "w:styleId": "pStyleId" } }, @@ -32,7 +33,7 @@ describe("Styles", () => { }, ], }); - const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); + const tree = new Formatter().format(styles)["w:styles"].filter((x: any) => !x._attr); expect(tree).to.deep.equal([ { "w:style": [ @@ -53,7 +54,7 @@ describe("Styles", () => { }, ], }); - const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); + const tree = new Formatter().format(styles)["w:styles"].filter((x: any) => !x._attr); expect(tree).to.deep.equal([ { "w:style": [ @@ -82,7 +83,7 @@ describe("Styles", () => { }, ], }); - const tree = new Formatter().format(styles)["w:styles"].filter((x) => !x._attr); + const tree = new Formatter().format(styles)["w:styles"].filter((x: any) => !x._attr); expect(tree).to.deep.equal([ { "w:style": [ diff --git a/src/file/table/table.spec.ts b/src/file/table/table.spec.ts index 38d0620f7d..53e823771b 100644 --- a/src/file/table/table.spec.ts +++ b/src/file/table/table.spec.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /* tslint:disable:no-unused-expression */ import { expect } from "chai"; @@ -344,10 +345,10 @@ describe("Table", () => { }); const tree = new Formatter().format(table); expect(tree).to.have.property("w:tbl").which.is.an("array"); - const row = tree["w:tbl"].find((x) => x["w:tr"]); + const row = tree["w:tbl"].find((x: any) => x["w:tr"]); expect(row).not.to.be.undefined; expect(row["w:tr"]).to.be.an("array").which.has.length.at.least(1); - expect(row["w:tr"].find((x) => x["w:tc"])).to.deep.equal({ + expect(row["w:tr"].find((x: any) => x["w:tc"])).to.deep.equal({ "w:tc": [ { "w:p": [ diff --git a/src/patcher/from-docx.ts b/src/patcher/from-docx.ts index e7480652fc..3990a7b93d 100644 --- a/src/patcher/from-docx.ts +++ b/src/patcher/from-docx.ts @@ -123,7 +123,8 @@ export const patchDocument = async (data: InputDataType, options: PatchDocumentO return element; } }), - }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, patchText, renderedParagraphs, context,