{"version":3,"file":"options.js","names":[],"sources":["../../../src/checkers/oxlint/options.ts"],"sourcesContent":["import path from 'node:path'\nimport { DiagnosticLevel, type OxlintConfig } from '../../types.js'\nimport { getOxlintCommand, mapSeverity } from './cli.js'\n\nexport interface ResolvedOptions {\n watchTarget: string | string[]\n logLevel?: DiagnosticLevel[]\n command: string[]\n debounceMs?: number\n}\n\nexport function resolveOptions(\n root: string,\n config: Exclude,\n): ResolvedOptions {\n const options = config === true ? { lintCommand: 'oxlint' } : config\n return {\n watchTarget: resolveWatchTarget(root, options.watchPath),\n logLevel: options.dev?.logLevel?.map((l) => mapSeverity(l)) ?? [\n DiagnosticLevel.Warning,\n DiagnosticLevel.Error,\n ],\n command: getOxlintCommand(options.lintCommand ?? 'oxlint'),\n debounceMs: options.dev?.debounceMs,\n }\n}\n\nfunction resolveWatchTarget(\n root: string,\n watchPath?: string | string[],\n): string | string[] {\n return Array.isArray(watchPath)\n ? watchPath.map((p) => path.resolve(root, p))\n : typeof watchPath === 'string'\n ? path.resolve(root, watchPath)\n : root\n}\n"],"mappings":";;;;AAWA,SAAgB,eACd,MACA,QACiB;CACjB,MAAM,UAAU,WAAW,OAAO,EAAE,aAAa,SAAS,IAAI;CAC9D,OAAO;EACL,aAAa,mBAAmB,MAAM,QAAQ,SAAS;EACvD,UAAU,QAAQ,KAAK,UAAU,KAAK,MAAM,YAAY,CAAC,CAAC,KAAK,CAAA,GAAA,CAG/D;EACA,SAAS,iBAAiB,QAAQ,eAAe,QAAQ;EACzD,YAAY,QAAQ,KAAK;CAC3B;AACF;AAEA,SAAS,mBACP,MACA,WACmB;CACnB,OAAO,MAAM,QAAQ,SAAS,IAC1B,UAAU,KAAK,MAAM,KAAK,QAAQ,MAAM,CAAC,CAAC,IAC1C,OAAO,cAAc,WACnB,KAAK,QAAQ,MAAM,SAAS,IAC5B;AACR"}