Files
openclaw/scripts/run-oxlint.d.mts
Peter Steinberger 5dafb13614 chore(scripts): end failing oxlint runs with a stable status line (#112532)
* chore(scripts): end failing oxlint runs with a stable status line

A crashed run-oxlint wrapper printed only a stack trace, and a lint
invocation whose output was truncated (cmd | tail -N) read as success —
which recently let a wrapper crash (stale node_modules after a dep-adding
merge) masquerade as a clean lint. Route the CLI entry through a small
wrapper that converts crashes into exit 1 and ends every failing run
with '[oxlint] FAILED (exit N)' as the final line.

* chore(scripts): declare runOxlintCliEntry in the script declaration contract

check-guards verifies .d.mts contracts against .mjs exports and
check-test-types consumes them; the new entry export needed both the
declaration and explicit log-parameter annotations in the test.
2026-07-21 22:53:12 -07:00

40 lines
1.2 KiB
TypeScript

/**
* Returns whether oxlint args need package-boundary declaration artifacts first.
*/
export function shouldPrepareExtensionPackageBoundaryArtifacts(args: unknown): boolean;
/**
* Drops tracked-but-missing sparse-checkout targets so narrow sparse checks can pass.
*/
export function filterSparseMissingOxlintTargets(
args: string[],
{
cwd,
fileExists,
isSparseCheckoutEnabled,
isTrackedPath,
}?: {
cwd?: string | undefined;
fileExists?: ((target: string) => boolean) | undefined;
isSparseCheckoutEnabled?: ((params: { cwd: string }) => boolean) | undefined;
isTrackedPath?: ((params: { cwd: string; target: string }) => boolean) | undefined;
},
): {
args: string[];
hadExplicitTargets: boolean;
remainingExplicitTargets: number;
skippedTargets: string[];
skippedConfigs: string[];
};
/**
* Applies wrapper policy and runs oxlint with the final argument list.
*/
export function main(argv?: string[], runtimeEnv?: NodeJS.ProcessEnv): Promise<void>;
/**
* CLI entry: converts wrapper crashes into exit 1 and ends every failing run
* with a stable `[oxlint] FAILED (exit N)` final line.
*/
export function runOxlintCliEntry(
run?: () => Promise<void>,
log?: (message: unknown) => void,
): Promise<void>;