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
+2 -2
View File
@@ -6,10 +6,10 @@ export default class Aetheryte {
}
constructor(
data: any,
data: {position: {x: number, y: number, zone: string}, name: {en: string}}
) {
this.position = data.position;
this.name = data.name.en;
this.name = data.name;
}
+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;
}
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
import {Job} from "../enums/Job";
import {NodeType} from "../enums/NodeType";
import {Job} from "@/enums/Job";
import {NodeType} from "@/enums/NodeType";
import Item from "./Item";
import Aetheryte from "./Aetheryte";
import TimeRange from "./TimeRange";
+4 -2
View File
@@ -4,8 +4,10 @@ export default class Zone {
en: string,
}
constructor(data: any) {
this.name = data.name;
constructor(data: {name: {en: string}}) {
this.name = {
en: data.name.en
};
}
}