Use new eslint-plugin-functional instead of tslint-immutable

This commit is contained in:
Dolan Miu
2022-09-15 20:00:50 +01:00
parent d020d59b11
commit e90d97b813
70 changed files with 321 additions and 436 deletions

View File

@ -1,11 +1,11 @@
import { BaseXmlComponent, IContext } from "./base";
import { IXmlableObject } from "./xmlable-object";
export type AttributeMap<T> = { [P in keyof T]: string };
export type AttributeMap<T> = { readonly [P in keyof T]: string };
export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
export abstract class XmlAttributeComponent<T extends object> extends BaseXmlComponent {
// tslint:disable-next-line:readonly-keyword
protected root: T;
protected readonly root: T;
protected readonly xmlKeys?: AttributeMap<T>;
public constructor(properties: T) {
@ -19,6 +19,7 @@ export abstract class XmlAttributeComponent<T> extends BaseXmlComponent {
const value = this.root[key];
if (value !== undefined) {
const newKey = (this.xmlKeys && this.xmlKeys[key]) || key;
// eslint-disable-next-line functional/immutable-data
attrs[newKey] = value;
}
});