mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
Fix misc problems detected by ESLint
Reformat and clean up issues detected by ESLint.
This commit is contained in:
1 parent
8cb21c5fa8
commit
e9f5cae4f0
34 files changed
+132
-189
No files matched your search
@@ -196,6 +196,7 @@ async function exportItems(server, modVersions, items) {
|
||||
iconLayer.scale(realScale);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-loop-func
|
||||
iconLayer.scan(0, 0, iconLayer.bitmap.width, iconLayer.bitmap.height, function(x, y, sidx) {
|
||||
x += xs;
|
||||
y += ys;
|
||||
|
||||
@@ -167,9 +167,9 @@ function randomDynamicPort() {
|
||||
async function generatePassword(length) {
|
||||
function validChar(byte) {
|
||||
const ranges = ["az", "AZ", "09"];
|
||||
return ranges.some(range =>
|
||||
return ranges.some(range => (
|
||||
range.codePointAt(0) <= byte && byte <= range.codePointAt(1)
|
||||
);
|
||||
));
|
||||
}
|
||||
let randomBytesAsync = util.promisify(crypto.randomBytes);
|
||||
|
||||
@@ -559,9 +559,9 @@ class FactorioServer extends events.EventEmitter {
|
||||
let channel = line
|
||||
.slice(6, channelEnd)
|
||||
.toString("utf-8")
|
||||
.replace(/\\x([0-9a-f]{2})/g, (match, p1) =>
|
||||
.replace(/\\x([0-9a-f]{2})/g, (match, p1) => (
|
||||
String.fromCharCode(parseInt(p1, 16))
|
||||
)
|
||||
))
|
||||
;
|
||||
|
||||
let type = line.slice(channelEnd + 1, channelEnd + 2).toString("utf-8");
|
||||
@@ -619,10 +619,8 @@ class FactorioServer extends events.EventEmitter {
|
||||
if (!expected.includes(output[name])) {
|
||||
continue heuristicLoop;
|
||||
}
|
||||
} else {
|
||||
if (expected !== output[name]) {
|
||||
continue heuristicLoop;
|
||||
}
|
||||
} else if (expected !== output[name]) {
|
||||
continue heuristicLoop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,7 +649,7 @@ class FactorioServer extends events.EventEmitter {
|
||||
};
|
||||
|
||||
this._rconClient = new rconClient.Rcon(config);
|
||||
this._rconClient.on("error", err => { /* Ignore */ });
|
||||
this._rconClient.on("error", () => { /* Ignore */ });
|
||||
this._rconClient.on("authenticated", () => { this._rconReady = true; this.emit("rcon-ready"); });
|
||||
this._rconClient.on("end", () => {
|
||||
this._rconClient = null;
|
||||
|
||||
Reference in new issue
Block a user