mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Lint with Oxlint through Vite+ instead of ESLint
Replace ESLint, typescript-eslint, eslint-plugin-node and the flat config helpers with vite-plus, which runs Oxlint for vp lint. The rules are carried over from eslint.config.mjs by @oxlint/migrate into the lint section of the root vite.config.ts. The formatting rules ESLint deprecated run as @stylistic rules through Oxlint's JS plugin support, and disable comments naming them are updated to the @stylistic names. @stylistic understands TypeScript syntax that the core rules skipped, so the autofix adds missing semicolons and spaces in type literals and aliases. Leading | and & in multiline types stay where they were. Oxlint's node/no-sync also reports identifiers ending in Sync that are not calls. The test helper techSync is renamed and the two other names are ignored. Refs #1127 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3227179613
commit
e94abe51c9
35 files changed
+445
-578
No files matched your search
@@ -9,7 +9,7 @@ type IpcPlayerAuth = {
|
||||
type: "set_verify_code",
|
||||
player: string,
|
||||
verify_code: string,
|
||||
}
|
||||
};
|
||||
|
||||
export default async function loadInstancePlugin(context: InstancePluginContext) {
|
||||
const { instance, host, logger, plugin } = context;
|
||||
|
||||
@@ -10,12 +10,12 @@ import { type Component, enabledComponents, stripPlayerData } from "./components
|
||||
|
||||
type IpcPlayerName = {
|
||||
player_name: string
|
||||
}
|
||||
};
|
||||
|
||||
type IpcDownloadRequest = {
|
||||
player_name: string,
|
||||
recipe_notifications?: string,
|
||||
}
|
||||
};
|
||||
|
||||
/** Components as an escaped JSON object for the scenario. */
|
||||
function componentsJson(enabled: Set<Component>) {
|
||||
@@ -30,7 +30,7 @@ type IpcAcquireResponse = {
|
||||
message?: string,
|
||||
epoch?: number,
|
||||
token?: string,
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Splits string into array of strings with max of a certain length
|
||||
@@ -64,7 +64,7 @@ export type RecipeNotificationDelta = {
|
||||
remove?: string[],
|
||||
/** add is the whole stored list, sent without the instance's: the save works out what to remove */
|
||||
full?: true,
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Compute the changes needed to turn the current cleared recipe list into the stored one
|
||||
|
||||
@@ -30,7 +30,7 @@ export type IpcPlayerData = {
|
||||
// Components the upload was serialized with, all when missing
|
||||
components?: Record<string, boolean> | unknown[],
|
||||
destination_instance_id?: number, // set_destination's instance, on the leave upload only; not player data
|
||||
}
|
||||
};
|
||||
|
||||
// Marks tombstones in player_sync.json
|
||||
const jsonReserved = { deleted: Type.Optional(Type.Never()) };
|
||||
|
||||
@@ -22,7 +22,7 @@ type Technology = {
|
||||
level: number,
|
||||
progress: number | null,
|
||||
researched: boolean,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
async function loadTechnologies(
|
||||
|
||||
@@ -145,21 +145,21 @@ describe("research_sync controller", function() {
|
||||
});
|
||||
|
||||
describe("technology sync unlocking several levels", function() {
|
||||
const techSync = (name, level, researched) => mock.getHandler(controller, SyncTechnologiesRequest)(
|
||||
const syncTech = (name, level, researched) => mock.getHandler(controller, SyncTechnologiesRequest)(
|
||||
new SyncTechnologiesRequest([new TechnologySync(name, level, null, researched)]), src
|
||||
);
|
||||
it("should drop one entry per level unlocked on a known technology", async function() {
|
||||
await techSync("m", 4, true);
|
||||
await syncTech("m", 4, true);
|
||||
await update(["m", "m", "m", "x"]);
|
||||
sent.length = 0;
|
||||
await techSync("m", 7, true);
|
||||
await syncTech("m", 7, true);
|
||||
assert.deepEqual(await sync(), ["x"]);
|
||||
assert.equal(queueEvents().length, 1);
|
||||
assert.deepEqual(queueEvents()[0][1], new QueueEvent(["x"], null, null));
|
||||
});
|
||||
it("should drop one entry per level unlocked on a new technology", async function() {
|
||||
await update(["m", "m", "x"]);
|
||||
await techSync("m", 2, true);
|
||||
await syncTech("m", 2, true);
|
||||
assert.deepEqual(await sync(), ["x"]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -26,12 +26,12 @@ type IpcStats = {
|
||||
weight: number,
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
type IpcFlowType = {
|
||||
"input": Record<string, number>,
|
||||
"output": Record<string, number>,
|
||||
}
|
||||
};
|
||||
|
||||
const instancePlayerCount = new Gauge(
|
||||
"clusterio_statistics_exporter_instance_player_count",
|
||||
|
||||
@@ -78,7 +78,9 @@ export class NeuralDole {
|
||||
}
|
||||
}
|
||||
|
||||
divider(object: { name:string, quality:string, count:number, instanceId:number, instanceName:string }): number {
|
||||
divider(
|
||||
object: { name: string, quality: string, count: number, instanceId: number, instanceName: string }
|
||||
): number {
|
||||
let magicData = doleNN.dose(
|
||||
object.count, // numReq
|
||||
this.items.getItemCount(object.name, object.quality) || 0,
|
||||
@@ -118,7 +120,7 @@ export function doleDivider(
|
||||
logItemTransfers,
|
||||
logger,
|
||||
} :{
|
||||
object: { name:string, quality:string, count:number, instanceId:number, instanceName:string },
|
||||
object: { name: string, quality: string, count: number, instanceId: number, instanceName: string },
|
||||
items: lib.ItemDatabase,
|
||||
logItemTransfers: boolean,
|
||||
logger: lib.Logger,
|
||||
|
||||
Reference in new issue
Block a user