Fix some linting errors

This commit is contained in:
Robin van der Linde 2023-07-27 14:41:55 +02:00
parent 011bbb3dbf
commit 9885099aff
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
3 changed files with 28 additions and 29 deletions

View file

@ -233,7 +233,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
}
public static TimesT<T>(count: number, f: (i: number) => T): T[] {
let res: T[] = []
const res: T[] = []
for (let i = 0; i < count; i++) {
res.push(f(i))
}
@ -827,7 +827,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
}
static getOrSetDefault<K, V>(dict: Map<K, V>, k: K, v: () => V) {
let found = dict.get(k)
const found = dict.get(k)
if (found !== undefined) {
return found
}
@ -848,7 +848,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
if (i >= 124) {
code += 1 // Character 127 is our 'escape' character |
}
let replacement = "|" + String.fromCharCode(code)
const replacement = "|" + String.fromCharCode(code)
stringified = stringified.replace(new RegExp(`\"${knownKey}\":`, "g"), replacement)
}
@ -1125,7 +1125,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
seconds = seconds % 60
let hours = Math.floor(minutes / 60)
minutes = minutes % 60
let days = Math.floor(hours / 24)
const days = Math.floor(hours / 24)
hours = hours % 24
if (days > 0) {
return days + "days" + " " + hours + "h"
@ -1272,7 +1272,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
for (const k in d) {
const vs = d[k]
for (let v of vs) {
for (const v of vs) {
const list = newD[v]
if (list === undefined) {
newD[v] = [k] // Left: indexing; right: list with one element
@ -1294,7 +1294,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
}
function componentToHex(n) {
let hex = n.toString(16)
const hex = n.toString(16)
return hex.length == 1 ? "0" + hex : hex
}
@ -1413,8 +1413,8 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return false
}
for (let i = 0; i < a.length; i++) {
let ai = a[i]
let bi = b[i]
const ai = a[i]
const bi = b[i]
if (ai == bi) {
continue
}
@ -1508,7 +1508,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
if (matchWithFuncName) {
;[_, functionName, path, line, column] = matchWithFuncName
} else {
let regexNoFuncName: RegExp = new RegExp("at ([a-zA-Z0-9/.]+):([0-9]+):([0-9]+)")
const regexNoFuncName: RegExp = new RegExp("at ([a-zA-Z0-9/.]+):([0-9]+):([0-9]+)")
;[_, path, line, column] = stackItem.match(regexNoFuncName)
}