chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -44,9 +44,7 @@ export const SERVICE_AUDIT_CODES = {
|
||||
systemdWantsNetworkOnline: "systemd-wants-network-online",
|
||||
} as const;
|
||||
|
||||
export function needsNodeRuntimeMigration(
|
||||
issues: ServiceConfigIssue[],
|
||||
): boolean {
|
||||
export function needsNodeRuntimeMigration(issues: ServiceConfigIssue[]): boolean {
|
||||
return issues.some(
|
||||
(issue) =>
|
||||
issue.code === SERVICE_AUDIT_CODES.gatewayRuntimeBun ||
|
||||
@@ -171,10 +169,7 @@ async function auditLaunchdPlist(
|
||||
}
|
||||
}
|
||||
|
||||
function auditGatewayCommand(
|
||||
programArguments: string[] | undefined,
|
||||
issues: ServiceConfigIssue[],
|
||||
) {
|
||||
function auditGatewayCommand(programArguments: string[] | undefined, issues: ServiceConfigIssue[]) {
|
||||
if (!programArguments || programArguments.length === 0) return;
|
||||
if (!hasGatewaySubcommand(programArguments)) {
|
||||
issues.push({
|
||||
@@ -218,8 +213,7 @@ function auditGatewayServicePath(
|
||||
if (!servicePath) {
|
||||
issues.push({
|
||||
code: SERVICE_AUDIT_CODES.gatewayPathMissing,
|
||||
message:
|
||||
"Gateway service PATH is not set; the daemon should use a minimal PATH.",
|
||||
message: "Gateway service PATH is not set; the daemon should use a minimal PATH.",
|
||||
level: "recommended",
|
||||
});
|
||||
return;
|
||||
@@ -230,9 +224,7 @@ function auditGatewayServicePath(
|
||||
.split(getPathModule(platform).delimiter)
|
||||
.map((entry) => entry.trim())
|
||||
.filter(Boolean);
|
||||
const normalizedParts = parts.map((entry) =>
|
||||
normalizePathEntry(entry, platform),
|
||||
);
|
||||
const normalizedParts = parts.map((entry) => normalizePathEntry(entry, platform));
|
||||
const missing = expected.filter((entry) => {
|
||||
const normalized = normalizePathEntry(entry, platform);
|
||||
return !normalizedParts.includes(normalized);
|
||||
@@ -284,8 +276,7 @@ async function auditGatewayRuntime(
|
||||
if (isBunRuntime(execPath)) {
|
||||
issues.push({
|
||||
code: SERVICE_AUDIT_CODES.gatewayRuntimeBun,
|
||||
message:
|
||||
"Gateway service uses Bun; Bun is incompatible with WhatsApp + Telegram channels.",
|
||||
message: "Gateway service uses Bun; Bun is incompatible with WhatsApp + Telegram channels.",
|
||||
detail: execPath,
|
||||
level: "recommended",
|
||||
});
|
||||
@@ -297,8 +288,7 @@ async function auditGatewayRuntime(
|
||||
if (isVersionManagedNodePath(execPath, platform)) {
|
||||
issues.push({
|
||||
code: SERVICE_AUDIT_CODES.gatewayRuntimeNodeVersionManager,
|
||||
message:
|
||||
"Gateway service uses Node from a version manager; it can break after upgrades.",
|
||||
message: "Gateway service uses Node from a version manager; it can break after upgrades.",
|
||||
detail: execPath,
|
||||
level: "recommended",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user