Fix linting and add new lint rules

This commit is contained in:
Dolan Miu
2022-09-19 20:48:50 +01:00
parent e90d97b813
commit 5950055cca
13 changed files with 78 additions and 46 deletions

View File

@ -1,4 +1,3 @@
// eslint-disable @typescript-eslint/no-explicit-any
import { Element as XmlElement, xml2js } from "xml-js";
import { IXmlableObject, XmlAttributeComponent, XmlComponent } from "@file/xml-components";
@ -15,7 +14,9 @@ export const convertToXmlComponent = (element: XmlElement): ImportedXmlComponent
switch (element.type) {
case undefined:
case "element":
// eslint-disable-next-line no-case-declarations
const xmlComponent = new ImportedXmlComponent(element.name as string, element.attributes);
// eslint-disable-next-line no-case-declarations
const childElements = element.elements || [];
for (const childElm of childElements) {
const child = convertToXmlComponent(childElm);
@ -31,6 +32,7 @@ export const convertToXmlComponent = (element: XmlElement): ImportedXmlComponent
}
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
class ImportedXmlComponentAttributes extends XmlAttributeComponent<any> {
// noop
}
@ -54,7 +56,7 @@ export class ImportedXmlComponent extends XmlComponent {
* @param importedContent xml content of the imported component
*/
// tslint:disable-next-line:variable-name
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public constructor(rootKey: string, _attr?: any) {
super(rootKey);
if (_attr) {
@ -71,7 +73,7 @@ export class ImportedXmlComponent extends XmlComponent {
* Used for the attributes of root element that is being imported.
*/
export class ImportedRootElementAttributes extends XmlComponent {
// tslint:disable-next-line:variable-name
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public constructor(private readonly _attr: any) {
super("");
}