{"record":{"id":"61062f5e3a434977","repo":"pbakaus/impeccable","slug":"pass-a-rule-id-and-value-e-g-impeccable-comman","errorCode":null,"errorMessage":"Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks ignore-value overused-font Inter","messagePattern":"Pass a rule id and value, e\\.g\\. (.+?) hooks ignore-value overused-font Inter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/skills/impeccable/scripts/hook-admin.mjs","lineNumber":697,"sourceCode":"  }\n\n  const [rule, ...valueParts] = positionals;\n  return {\n    rule: String(rule || '').trim().toLowerCase(),\n    value: normalizeIgnoreValue(valueParts.join(' ')),\n    // Sorted: the dedup key compares the files array, so an unsorted scope made\n    // `--file b.css --file a.css` a different entry from `--file a.css --file b.css`.\n    files: Array.from(new Set(files.filter(Boolean))).sort(),\n    shared,\n    local,\n    reason,\n  };\n}\n\nfunction addIgnoreValue(cwd, args) {\n  const parsed = parseIgnoreValueArgs(args);\n  if (!parsed.rule || !parsed.value) {\n    throw new Error(`Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks ignore-value overused-font Inter`);\n  }\n\n  if (parsed.shared && parsed.local) {\n    throw new Error('Pass only one scope flag: --shared or --local');\n  }\n\n  // A bare `*` would suppress the rule everywhere, which is ignore-rule's job and\n  // not what a finding in one file justifies. detector.ignoreValues honours a\n  // `files` scope, so require one — matching `impeccable ignores add-value`.\n  if (parsed.value === '*' && parsed.files.length === 0) {\n    // `ignore-rule overused-font` refuses on its own without --all-values, so\n    // naming the bare form here would hand the user a second error.\n    const projectWide = parsed.rule === 'overused-font'\n      ? `${IMPECCABLE_COMMAND} hooks ignore-rule ${parsed.rule} --all-values`\n      : `${IMPECCABLE_COMMAND} hooks ignore-rule ${parsed.rule}`;\n    throw new Error(`Wildcard value ignores must be scoped with --file <glob>, e.g. ${IMPECCABLE_COMMAND} hooks ignore-value design-system-font-size \"*\" --file \"src/widget.js\". To suppress the rule project-wide use ${projectWide}.`);\n  }\n","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/plugin/skills/impeccable/scripts/hook-admin.mjs#L679-L715","documentation":"addIgnoreValue() requires two positionals: a rule id and a value (e.g. the font family for overused-font). The value is built by joining all positionals after the rule and running normalizeIgnoreValue on them. If either rule or value is empty after parsing, the command refuses with a concrete example rather than storing an incomplete ignore entry.","triggerScenarios":"Running `hooks ignore-value overused-font` (rule present, value missing) or `hooks ignore-value` (both missing); supplying only flags.","commonSituations":"Forgetting the value half of a value-specific rule; a script that drops the value under some path.","solutions":["Provide both a rule id and a value, e.g. `hooks ignore-value overused-font Inter`.","If automating, assert both positionals are non-empty before invoking."],"exampleFix":"# before\nimpeccable hooks ignore-value overused-font\n\n# after\nimpeccable hooks ignore-value overused-font Inter","handlingStrategy":"validation","validationCode":"if (!parsed.rule || !parsed.value) {\n  throw new Error('Pass a rule id and value, e.g. /impeccable hooks ignore-value overused-font Inter');\n}","typeGuard":"function hasRuleAndValue(parsed) {\n  return typeof parsed.rule === 'string' && parsed.rule !== ''\n    && typeof parsed.value === 'string' && parsed.value !== '';\n}","tryCatchPattern":null,"preventionTips":["Supply both a rule id and a value positional for value-specific rules.","When automating, assert both positionals are non-empty before invoking."],"tags":["cli","argument-parsing","validation"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}