Fix ESLinting errors and remove TSLint

This commit is contained in:
Dolan Miu
2022-08-31 08:59:27 +01:00
parent 1bdf9a4987
commit ebcb37cbed
30 changed files with 104 additions and 201 deletions

View File

@ -1,9 +1,10 @@
import { expect } from "chai";
import { Element, xml2js } from "xml-js";
import { EMPTY_OBJECT, ImportedXmlComponent } from "./";
import { EMPTY_OBJECT } from "@file/xml-components";
import { convertToXmlComponent, ImportedXmlComponent } from "./imported-xml-component";
import { IContext } from "./base";
import { convertToXmlComponent } from "./imported-xml-component";
const xmlString = `
<w:p w:one="value 1" w:two="value 2">

View File

@ -1,6 +1,8 @@
// tslint:disable:no-any
import { Element as XmlElement, xml2js } from "xml-js";
import { IXmlableObject, XmlAttributeComponent, XmlComponent } from ".";
import { IXmlableObject, XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { IContext } from "./base";
/**
@ -8,7 +10,7 @@ import { IContext } from "./base";
* @param element the xml element in json presentation
*/
export function convertToXmlComponent(element: XmlElement): ImportedXmlComponent | string | undefined {
export const convertToXmlComponent = (element: XmlElement): ImportedXmlComponent | string | undefined => {
switch (element.type) {
case undefined:
case "element":
@ -26,7 +28,7 @@ export function convertToXmlComponent(element: XmlElement): ImportedXmlComponent
default:
return undefined;
}
}
};
class ImportedXmlComponentAttributes extends XmlAttributeComponent<any> {
// noop