chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -44,16 +44,12 @@ export function createBrowserProfilesService(ctx: BrowserRouteContext) {
return await ctx.listProfiles();
};
const createProfile = async (
params: CreateProfileParams,
): Promise<CreateProfileResult> => {
const createProfile = async (params: CreateProfileParams): Promise<CreateProfileResult> => {
const name = params.name.trim();
const rawCdpUrl = params.cdpUrl?.trim() || undefined;
if (!isValidProfileName(name)) {
throw new Error(
"invalid profile name: use lowercase letters, numbers, and hyphens only",
);
throw new Error("invalid profile name: use lowercase letters, numbers, and hyphens only");
}
const state = ctx.state();
@@ -70,9 +66,7 @@ export function createBrowserProfilesService(ctx: BrowserRouteContext) {
const usedColors = getUsedColors(resolvedProfiles);
const profileColor =
params.color && HEX_COLOR_RE.test(params.color)
? params.color
: allocateColor(usedColors);
params.color && HEX_COLOR_RE.test(params.color) ? params.color : allocateColor(usedColors);
let profileConfig: BrowserProfileConfig;
if (rawCdpUrl) {
@@ -80,9 +74,7 @@ export function createBrowserProfilesService(ctx: BrowserRouteContext) {
profileConfig = { cdpUrl: parsed.normalized, color: profileColor };
} else {
const usedPorts = getUsedPorts(resolvedProfiles);
const range = deriveDefaultBrowserCdpPortRange(
state.resolved.controlPort,
);
const range = deriveDefaultBrowserCdpPortRange(state.resolved.controlPort);
const cdpPort = allocateCdpPort(usedPorts, range);
if (cdpPort === null) {
throw new Error("no available CDP ports in range");
@@ -119,9 +111,7 @@ export function createBrowserProfilesService(ctx: BrowserRouteContext) {
};
};
const deleteProfile = async (
nameRaw: string,
): Promise<DeleteProfileResult> => {
const deleteProfile = async (nameRaw: string): Promise<DeleteProfileResult> => {
const name = nameRaw.trim();
if (!name) throw new Error("profile name is required");
if (!isValidProfileName(name)) {