File tree Expand file tree Collapse file tree
scripts/fleet/ai-lint-fix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,9 +55,10 @@ export interface OxlintJsonOutput {
5555
5656/**
5757 * Normalize oxlint's `{diagnostics:[...]}` payload into the ESLint-style
58- * `OxlintFile[]` shape the rest of the step expects. Strip the `socket(...)`
59- * wrapper around the rule code so AI_HANDLED_RULES (which stores bare rule
60- * names) matches.
58+ * `OxlintFile[]` shape the rest of the step expects. Convert the oxlint code
59+ * form `socket(rule)` into the `socket/rule` form that AI_HANDLED_RULES,
60+ * RULE_GUIDANCE, and RULE_MODEL_TIER are keyed on (the same id used in
61+ * oxlintrc `rules`). Stripping to a bare `rule` would never match those sets.
6162 */
6263export function normalizeOxlintJson ( payload : OxlintJsonOutput ) : OxlintFile [ ] {
6364 const byFile = new Map < string , OxlintMessage [ ] > ( )
@@ -70,7 +71,7 @@ export function normalizeOxlintJson(payload: OxlintJsonOutput): OxlintFile[] {
7071 // "eslint(no-unused-vars)"; strip the plugin wrapper.
7172 const ruleId =
7273 typeof d . code === 'string' && d . code . includes ( '(' )
73- ? d . code . replace ( / ^ [ ^ ( ] + \( ( [ ^ ) ] + ) \) .* $ / , '$1' ) // `^ [^(]+` plugin name ; `([^)]+)` captures rule id; `\).*$` discards the rest
74+ ? d . code . replace ( / ^ ( [ ^ ( ] + ) \( ( [ ^ ) ] + ) \) .* $ / , '$1/$2 ' ) // `( [^(]+) ` plugin; `([^)]+)` rule -> `plugin/rule` to match the keyed sets
7475 : d . code
7576 const msg : OxlintMessage = {
7677 ruleId,
You can’t perform that action at this time.
0 commit comments