{"record":{"id":"bdec6b09d06938bf","repo":"pbakaus/impeccable","slug":"unknown-ignore-rule-flag-arg","errorCode":null,"errorMessage":"Unknown ignore-rule flag: ${arg}","messagePattern":"Unknown ignore-rule flag: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/skills/impeccable/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/plugin/skills/impeccable/scripts/hook-admin.mjs#L546-L582","documentation":"parseIgnoreRuleArgs() accepts only two flags for `hooks ignore-rule`: `--all-values` and `--reason`/`--reason=` (the latter is accepted for command symmetry but stored nowhere, since ignoreRules holds rule ids only). Any other token beginning with `--` is treated as an unknown flag and rejected immediately, to stop a typo from folding silently into a stored value.","triggerScenarios":"Running `hooks ignore-rule <rule>` with an unrecognized flag such as `--all` (instead of `--all-values`), or a flag that belongs to a different subcommand like `--file`, `--shared`, or `--local`.","commonSituations":"Muscle memory from ignore-value/ignore-file flag sets; abbreviation mistakes (`--all` vs `--all-values`); copy-pasting a command from a different subcommand's help.","solutions":["Use exactly `--all-values` (full name) and/or `--reason [text]`.","Remove flags that belong to other subcommands (--file, --shared, --local are not valid for ignore-rule).","Re-read the accepted flag set: only --all-values and --reason."],"exampleFix":"# before\nimpeccable hooks ignore-rule side-tab --all\n\n# after\nimpeccable hooks ignore-rule side-tab --all-values","handlingStrategy":"validation","validationCode":"const IGNORE_RULE_FLAGS = new Set(['--all-values', '--reason']);\nfunction validateIgnoreRuleArgs(args) {\n  for (const a of args) {\n    if (String(a).startsWith('--') && !IGNORE_RULE_FLAGS.has(a) && !String(a).startsWith('--reason=')) {\n      throw new Error(`Unknown ignore-rule flag: ${a}`);\n    }\n  }\n}","typeGuard":"function isKnownIgnoreRuleFlag(arg) {\n  return arg === '--all-values' || arg === '--reason' || arg.startsWith('--reason=');\n}","tryCatchPattern":null,"preventionTips":["Memorize the ignore-rule flag set: only --all-values and --reason.","Don't carry over flags from ignore-value/ignore-file (no --file/--shared/--local here).","When automating, validate argv against the known flag set before invoking."],"tags":["cli","argument-parsing"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}