{"record":{"id":"e3f9f66488666323","repo":"pbakaus/impeccable","slug":"unknown-ignore-rule-flag-arg-e3f9f6","errorCode":null,"errorMessage":"Unknown ignore-rule flag: ${arg}","messagePattern":"Unknown ignore-rule flag: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":564,"sourceCode":"\nfunction normalizeRuleId(rule) {\n  return String(rule || '').trim().toLowerCase();\n}\n\nfunction parseIgnoreRuleArgs(args) {\n  const positionals = [];\n  let allValues = false;\n\n  for (let i = 0; i < args.length; i++) {\n    const arg = String(args[i] || '');\n    if (arg === '--all-values') {\n      allValues = true;\n    } else if (arg === '--reason') {\n      while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) i++;\n    } else if (arg.startsWith('--reason=')) {\n      // Accepted for command symmetry; ignoreRules stores rule ids only.\n    } else if (arg.startsWith('--')) {\n      throw new Error(`Unknown ignore-rule flag: ${arg}`);\n    } else {\n      positionals.push(arg);\n    }\n  }\n\n  return {\n    rule: normalizeRuleId(positionals[0]),\n    allValues,\n  };\n}\n\nfunction addIgnoreRule(cwd, args) {\n  const parsed = parseIgnoreRuleArgs(args);\n  const rule = parsed.rule;\n  if (!rule) throw new Error(`Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule side-tab`);\n  if (rule === 'overused-font' && !parsed.allValues) {\n    throw new Error(`overused-font is value-specific by default. Use ${IMPECCABLE_COMMAND} hooks ignore-value overused-font <font> for a confirmed font, or ${IMPECCABLE_COMMAND} hooks ignore-rule overused-font --all-values only when the user asked to ignore overused fonts generally.`);\n  }","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/hook-admin.mjs#L546-L582","documentation":"Thrown by parseIgnoreRuleArgs when an argument starts with '--' but is not one of the recognized ignore-rule flags (--all-values, --reason, --reason=<...>). ignore-rule stores rule ids only, so its flag surface is intentionally tiny; unknown flags are rejected rather than silently dropped. Notably --shared/--local belong to ignore-file, not ignore-rule.","triggerScenarios":"Passing --shared or --local to ignore-rule (they are ignore-file scope flags); passing --force, --recursive, or a typo like --all-val; passing a flag meant for ignore-value.","commonSituations":"Copy-pasting flags from an ignore-file command; assuming ignore-rule and ignore-value share the same flag surface; a typo.","solutions":["For ignore-rule, use only --all-values (and optionally --reason <text>).","If you meant to scope to files, use ignore-file with a glob instead.","If you meant a value-specific exception, use ignore-value <rule> <value>."],"exampleFix":"# before\nimpeccable hooks ignore-rule side-tab --shared\n\n# after (ignore-rule has no scope flag)\nimpeccable hooks ignore-rule side-tab\n# to scope to files instead:\nimpeccable hooks ignore-file \"src/legacy/**\"","handlingStrategy":"validation","validationCode":"// Validate ignore-rule args before dispatch.\nconst RULE_FLAGS = new Set(['--all-values', '--reason']);\nfunction validateIgnoreRuleArgs(args) {\n  for (const a of args) {\n    if (a.startsWith('--') && !RULE_FLAGS.has(a) && !a.startsWith('--reason=')) {\n      throw new Error(`Unknown ignore-rule flag: ${a}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember ignore-rule accepts only --all-values and --reason.","--shared/--local belong to ignore-file; --all-values is not for ignore-file.","When in doubt, run the command with --help to see the exact flag surface."],"tags":["cli","hooks","validation","config","arg-parsing"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}