mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +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
@@ -310,18 +310,6 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
|
||||
console.error("SOCKET | Error:", err);
|
||||
});
|
||||
|
||||
/*
|
||||
this._socket.on("unexpected-response", (req, res) => {
|
||||
let data = "";
|
||||
res.on('data', (chunk) => { data += chunk; });
|
||||
res.on('end', () => {
|
||||
console.error(`SOCKET | Unexpeced Response ${res.statusCode}`);
|
||||
console.error(data);
|
||||
this._socket.emit("error", new Error(`Unexpected Response ${res.statusCode}`));
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
this._socket.on("open", () => {
|
||||
console.log("SOCKET | Open");
|
||||
});
|
||||
|
||||
+10
-8
@@ -11,8 +11,8 @@ const errors = require("lib/errors");
|
||||
class Message {
|
||||
/**
|
||||
* Name of the plugin this message belongs to, or null.
|
||||
* @returns {?string}
|
||||
**/
|
||||
* @returns {?string} - plugin name or null if not from a plugin.
|
||||
*/
|
||||
get plugin() {
|
||||
if (this._plugin === undefined) {
|
||||
let index = this.type.indexOf(":");
|
||||
@@ -78,9 +78,10 @@ class Request extends Message {
|
||||
}
|
||||
|
||||
if (forwardTo === "instance") {
|
||||
requestProperties = Object.assign(
|
||||
{ "instance_id": { type: "integer" }}, requestProperties
|
||||
);
|
||||
requestProperties = {
|
||||
"instance_id": { type: "integer" },
|
||||
...requestProperties,
|
||||
};
|
||||
|
||||
} else if (forwardTo !== "master" && forwardTo !== null) {
|
||||
throw new Error(`Invalid forwardTo value ${forwardTo}`);
|
||||
@@ -635,9 +636,10 @@ class Event extends Message {
|
||||
this.broadcastTo = broadcastTo;
|
||||
|
||||
if (forwardTo === "instance") {
|
||||
eventProperties = Object.assign(
|
||||
{ "instance_id": { type: "integer" }}, eventProperties
|
||||
);
|
||||
eventProperties = {
|
||||
"instance_id": { type: "integer" },
|
||||
...eventProperties,
|
||||
};
|
||||
|
||||
} else if (forwardTo !== "master" && forwardTo !== null) {
|
||||
throw new Error(`Invalid forwardTo value ${forwardTo}`);
|
||||
|
||||
Reference in new issue
Block a user