Fix code style errors

Remove extra whitespace, use more consistent spacing, add missing
semicolons, using dangling commas, break up long lines, consistent
multiline operator placement, add missing JSDoc strings and so on.
This commit is contained in:
Hornwitser committed 2023-11-19 04:48:38 +01:00
1 parent 97e05c0610
commit 7314dc99c8
71 files changed
+403 -290

No files matched your search

+8 -10
View File
@@ -83,18 +83,16 @@ void new lib.Gauge(
"clusterio_controller_websocket_active_connections",
"How many WebSocket connections are currently open to the controller",
{ callback: function(gauge:lib.Gauge) {
gauge.set(controller.wsServer.activeConnectors.size);
}
}
gauge.set(controller.wsServer.activeConnectors.size);
}}
);
void new lib.Gauge(
"clusterio_controller_active_hosts",
"How many hosts are currently connected to the controller",
{ callback: function(gauge:lib.Gauge) {
gauge.set(controller.wsServer.hostConnections.size);
}
}
gauge.set(controller.wsServer.hostConnections.size);
}}
);
void new lib.Gauge(
@@ -294,7 +292,7 @@ async function initialize(): Promise<InitializeParameters> {
logger.info(`Loading available plugins from ${args.pluginList}`);
let pluginList = new Map();
try {
pluginList = new Map(JSON.parse(await fs.readFile(args.pluginList, { encoding: 'utf8' })));
pluginList = new Map(JSON.parse(await fs.readFile(args.pluginList, { encoding: "utf8" })));
} catch (err: any) {
if (err.code !== "ENOENT") {
throw err;
@@ -324,7 +322,7 @@ async function initialize(): Promise<InitializeParameters> {
logger.info(`Loading config from ${controllerConfigPath}`);
const controllerConfig = new lib.ControllerConfig("controller");
try {
let fileData = await fs.readFile(controllerConfigPath, { encoding: 'utf8' })
let fileData = await fs.readFile(controllerConfigPath, { encoding: "utf8" });
await controllerConfig.load(JSON.parse(fileData));
} catch (err: any) {
@@ -363,7 +361,7 @@ async function initialize(): Promise<InitializeParameters> {
controllerConfigPath,
controllerConfig,
shouldRun,
}
};
}
async function startup() {
@@ -377,7 +375,7 @@ async function startup() {
clusterLogger,
pluginInfos,
controllerConfigPath,
controllerConfig
controllerConfig,
} = await initialize();
if (!shouldRun || !pluginInfos || !controllerConfigPath || !controllerConfig) {
return;