mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Fix linting issues with new rules
This commit is contained in:
1 parent
256407b9fd
commit
7e2f10e842
32 files changed
+65
-66
No files matched your search
@@ -11,7 +11,7 @@ async function exec(file, args) {
|
||||
const { stdout, stderr } = await execFile(
|
||||
file,
|
||||
args.map(escapeArg),
|
||||
// eslint-disable-next-line node/no-process-env
|
||||
|
||||
{ shell: true, cwd: __dirname, env: { ...process.env, pct: "%"} }
|
||||
);
|
||||
return { stdout: JSON.parse(stdout), stderr };
|
||||
|
||||
@@ -120,7 +120,7 @@ class TestHostConnector extends lib.WebSocketClientConnector {
|
||||
// Mark that this test takes a lot of time, or depeneds on a test
|
||||
// that takes a lot of time.
|
||||
function slowTest(test) {
|
||||
// eslint-disable-next-line node/no-process-env
|
||||
|
||||
if (process.env.FAST_TEST) {
|
||||
test.skip();
|
||||
}
|
||||
@@ -221,7 +221,7 @@ function getControl() {
|
||||
}
|
||||
|
||||
function spawn(name, cmd, waitFor) {
|
||||
// eslint-disable-next-line node/no-process-env
|
||||
|
||||
const silent = process.env.SILENT_TEST;
|
||||
const bootstrap = !controllerProcess || !hostProcess;
|
||||
function log(...args) {
|
||||
@@ -264,7 +264,7 @@ async function spawnNode(name, cmd, waitFor) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
|
||||
// eslint-disable-next-line node/no-process-env
|
||||
|
||||
const silent = process.env.SILENT_TEST;
|
||||
if (silent) {
|
||||
console.log("SILENT_TEST is present in env, loggers after bootstrap will be muted.");
|
||||
@@ -278,7 +278,7 @@ before(async function() {
|
||||
}));
|
||||
|
||||
// If fast test is enabled then output that it is
|
||||
// eslint-disable-next-line node/no-process-env
|
||||
|
||||
if (process.env.FAST_TEST) {
|
||||
console.log("FAST_TEST is present in env, slow tests will be skipped.");
|
||||
}
|
||||
|
||||
@@ -816,24 +816,24 @@ describe("lib/ModStore", function () {
|
||||
assert.equal(
|
||||
typeof firstMod.latest_release.version,
|
||||
"string",
|
||||
"latest_release version should be string" // eslint-disable-line max-len
|
||||
"latest_release version should be string"
|
||||
);
|
||||
assert.equal(
|
||||
typeof firstMod.latest_release.sha1,
|
||||
"string",
|
||||
"latest_release should have a sha1 string" // eslint-disable-line max-len
|
||||
"latest_release should have a sha1 string"
|
||||
);
|
||||
assert.ok(firstMod.latest_release.info_json, "latest_release should have info_json");
|
||||
assert.equal(
|
||||
typeof firstMod.latest_release.info_json.factorio_version,
|
||||
"string",
|
||||
"info_json should have factorio_version string" // eslint-disable-line max-len
|
||||
"info_json should have factorio_version string"
|
||||
);
|
||||
// Check for an expected field from the user example
|
||||
assert.equal(
|
||||
typeof firstMod.downloads_count,
|
||||
"number",
|
||||
"First mod should have downloads_count number" // eslint-disable-line max-len
|
||||
"First mod should have downloads_count number"
|
||||
);
|
||||
} else {
|
||||
// This should not happen for v1.1 but handles edge cases
|
||||
|
||||
@@ -303,7 +303,7 @@ describe("lib/data/ModPack", function() {
|
||||
Buffer.from(str),
|
||||
];
|
||||
}
|
||||
/* eslint-disable indent */
|
||||
/* eslint-disable @stylistic/indent */
|
||||
assert.deepEqual(
|
||||
pack.toModSettingsDat(),
|
||||
Buffer.concat([
|
||||
@@ -373,7 +373,6 @@ describe("lib/data/ModPack", function() {
|
||||
new Uint8Array(Float64Array.from([1]).buffer),
|
||||
])
|
||||
);
|
||||
/* eslint-enable indent */
|
||||
});
|
||||
});
|
||||
describe("defaultModPacks", function() {
|
||||
|
||||
@@ -46,7 +46,7 @@ describe("lib/plugin_loader", function() {
|
||||
it("should reject on broken plugin", async function() {
|
||||
let brokenMessage;
|
||||
try {
|
||||
// eslint-disable-next-line node/global-require
|
||||
|
||||
require(path.resolve(brokenPlugin));
|
||||
} catch (err) {
|
||||
brokenMessage = err.message;
|
||||
|
||||
Reference in new issue
Block a user