{"version":3,"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}\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').join(' '),\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":"AAAA,OAAO,UAAU;AACjB,SAAS,uBAA0C;AACnD,SAAS,kBAAkB,mBAAmB;AAQvC,SAAS,eACd,MACA,QACiB;AAbnB;AAcE,QAAM,UAAU,WAAW,OAAO,EAAE,aAAa,SAAS,IAAI;AAC9D,SAAO;AAAA,IACL,aAAa,mBAAmB,MAAM,QAAQ,SAAS;AAAA,IACvD,YAAU,mBAAQ,QAAR,mBAAa,aAAb,mBAAuB,IAAI,CAAC,MAAM,YAAY,CAAC,OAAM;AAAA,MAC7D,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,IAClB;AAAA,IACA,SAAS,iBAAiB,QAAQ,eAAe,QAAQ,EAAE,KAAK,GAAG;AAAA,EACrE;AACF;AAEA,SAAS,mBACP,MACA,WACmB;AACnB,SAAO,MAAM,QAAQ,SAAS,IAC1B,UAAU,IAAI,CAAC,MAAM,KAAK,QAAQ,MAAM,CAAC,CAAC,IAC1C,OAAO,cAAc,WACnB,KAAK,QAAQ,MAAM,SAAS,IAC5B;AACR;","names":[]}