mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15:33:12 +09:00
Fix the remaning linter warnings (#353)
Refactor the code base to remove all of the remaining warnings from ESLint and convert them into errors.
This commit is contained in:
1 parent
9243731646
commit
1b901f5d1c
33 files changed
+718
-609
No files matched your search
@@ -173,7 +173,7 @@ describe("Integration of Clusterio", function() {
|
||||
],
|
||||
];
|
||||
|
||||
for (let [prop, value, ,] of testConfigs) {
|
||||
for (let [prop, value] of testConfigs) {
|
||||
value = `"'${JSON.stringify(value).replace(/"/g, process.platform === "win32" ? '""' : '\\"')}'"`;
|
||||
let args = `test factorio.settings ${prop} ${value}`;
|
||||
await execCtl(`instance config set-prop ${args}`);
|
||||
|
||||
@@ -34,7 +34,7 @@ describe("Integration of lib/factorio/server", function() {
|
||||
await fs.ensureDir(writePath);
|
||||
logFile = fs.createWriteStream(path.join(writePath, "log.txt"), "utf8");
|
||||
server.on("output", function(output) {
|
||||
logFile.write(JSON.stringify(output) + "\n");
|
||||
logFile.write(`${JSON.stringify(output)}\n`);
|
||||
});
|
||||
|
||||
// Initialize sever.
|
||||
@@ -71,7 +71,7 @@ describe("Integration of lib/factorio/server", function() {
|
||||
});
|
||||
|
||||
function log(message) {
|
||||
logFile.write("=================== " + message + "\n");
|
||||
logFile.write(`=================== ${message}\n`);
|
||||
}
|
||||
|
||||
describe(".create()", function() {
|
||||
|
||||
@@ -351,8 +351,11 @@ describe("lib/config/classes", function() {
|
||||
assert.deepEqual(testInstance.get("json"), { json: true });
|
||||
|
||||
let errMsg;
|
||||
try { JSON.parse("blah"); }
|
||||
catch (err) { errMsg = err.message; }
|
||||
try {
|
||||
JSON.parse("blah");
|
||||
} catch (err) {
|
||||
errMsg = err.message;
|
||||
}
|
||||
assert.throws(
|
||||
() => testInstance.set("json", "blah"),
|
||||
new classes.InvalidValue(`Error parsing value for json: ${errMsg}`)
|
||||
|
||||
Reference in new issue
Block a user