install and configure eslint, bow before eslint

This commit is contained in:
2023-10-12 17:20:28 +02:00
parent b6bf355750
commit eb78ce7b6f
13 changed files with 1739 additions and 155 deletions
+10 -5
View File
@@ -3,13 +3,18 @@ export default class Item {
readonly id: string;
readonly name: string;
readonly level: number;
readonly scripType: ScripType;
readonly scripType: ScripType | null;
constructor(id: string, data: any) {
constructor(id: string, data: {[key: string]: number | string | undefined}) {
this.id = id;
this.name = data?.name;
this.level = data?.level;
this.scripType = data?.scripType ? ScripType[data.scripType.toUpperCase()] : null;
this.name = data?.name as string;
this.level = data?.level as number;
const scripType: string | undefined = data?.scripType as string;
if (scripType != undefined) {
this.scripType = typeof data?.scripType === "string" ? scripType.toUpperCase() as ScripType : null;
} else {
this.scripType = null;
}
}
}