mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
16 lines
513 B
JavaScript
16 lines
513 B
JavaScript
import process from 'node:process'
|
|
import { resolveOxcCliInvocation } from './oxc-cli-invocation.mjs'
|
|
|
|
export function resolveOxlintInvocation(root = process.cwd()) {
|
|
return resolveOxcCliInvocation('oxlint', 'oxlint', root)
|
|
}
|
|
|
|
export function parseOxlintOutput(stdout, label) {
|
|
const start = stdout.indexOf('{')
|
|
const end = stdout.lastIndexOf('}')
|
|
if (start === -1 || end === -1) {
|
|
throw new Error(`${label} did not return Oxlint JSON output.`)
|
|
}
|
|
return JSON.parse(stdout.slice(start, end + 1))
|
|
}
|