{"record":{"id":"acef50b901b283cf","repo":"pbakaus/impeccable","slug":"pass-a-rule-id-and-value-e-g-impeccable-comman-acef50","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":"Error","httpStatus":null,"severity":"error","filePath":"skill/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/skill/scripts/hook-admin.mjs#L679-L715","documentation":"Thrown by addIgnoreValue() when, after parsing, either the rule id or the value positional is empty. Impeccable needs both a rule id (e.g. overused-font) and a value (e.g. Inter) to build a scoped value-suppression entry, so a missing half is refused up front with a concrete example.","triggerScenarios":"Calling `impeccable hooks ignore-value` with zero args, one positional, or only flags (e.g. `ignore-value --local`, `ignore-value overused-font`, or `ignore-value \"\" Inter`). Also when the value is only whitespace, which normalizeIgnoreValue trims to empty.","commonSituations":"Forgetting the value half, or passing a rule id that the user assumes is enough (it is not — value-scoped suppression requires the offending value).","solutions":["Provide both a rule id and a value: `impeccable hooks ignore-value overused-font Inter`.","If you only have a rule id and want to suppress the whole rule, use `impeccable hooks ignore-rule <rule>` instead.","Confirm the rule id is a known detector rule (e.g. overused-font, design-system-font-size) so the value can be matched."],"exampleFix":"// before\nimpeccable hooks ignore-value overused-font\n// after\nimpeccable hooks ignore-value overused-font Inter","handlingStrategy":"validation","validationCode":"const [rule, ...valueParts] = positionals;\nconst value = valueParts.join(' ').trim();\nif (!rule || !value) {\n  throw new Error('ignore-value needs both a rule id and a value');\n}","typeGuard":"function hasRuleAndValue(positionals) {\n  return positionals.length >= 2 && positionals.every(p => typeof p === 'string' && p.trim() !== '');\n}","tryCatchPattern":null,"preventionTips":["Always pass two positionals: rule id then value.","If only a rule id is needed, use ignore-rule instead."],"tags":["cli","validation","ignore-config","impeccable-hooks"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}