{"record":{"id":"af5e3e8dec6d8fd2","repo":"pbakaus/impeccable","slug":"wildcard-value-ignores-must-be-scoped-with-file","errorCode":null,"errorMessage":"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}.","messagePattern":"Wildcard value ignores must be scoped with --file <glob>, e\\.g\\. (.+?) hooks ignore-value design-system-font-size \"\\*\" --file \"src/widget\\.js\"\\. To suppress the rule project-wide use (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/hook-admin.mjs","lineNumber":713,"sourceCode":"  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\n  const local = parsed.local;\n  const config = mergeDetectorConfig(readRawDetectorConfig(cwd, { local }));\n  // Key on the file scope too: the same rule/value legitimately appears more than\n  // once with different scopes, and a rule+value-only key overwrote them.\n  const key = ignoreValueEntryKey({ rule: parsed.rule, value: parsed.value, files: parsed.files });\n  const existing = config.ignoreValues.find((entry) => ignoreValueEntryKey(entry) === key);\n\n  if (existing) {\n    if (parsed.reason) existing.reason = parsed.reason;\n  } else {\n    const entry = {\n      rule: parsed.rule,\n      value: parsed.value,\n    };\n    if (parsed.files.length) entry.files = parsed.files;\n    entry.createdAt = new Date().toISOString();","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/hook-admin.mjs#L695-L731","documentation":"Thrown by addIgnoreValue when the value is the bare wildcard `*` and no --file/--files glob scopes it. A `*` value without a file scope would suppress the rule for every value everywhere, which is exactly what ignore-rule does — and ignore-rule already has its own safety interlock (overused-font requires --all-values there). The error routes you to either a scoped wildcard or the proper project-wide command, and for overused-font it pre-computes the --all-values form so you are not handed a second error.","triggerScenarios":"`hooks ignore-value design-system-font-size \"*\"` (no --file); `hooks ignore-value overused-font \"*\"`; agents translating 'suppress this finding anywhere in the widget' into a wildcard without the file scope the intent implies.","commonSituations":"Users wanting 'ignore all values of this rule in one area' and not realizing the glob is the scoping mechanism; attempts to bypass the overused-font guard by going through ignore-value with a wildcard.","solutions":["Scope the wildcard: `hooks ignore-value design-system-font-size \"*\" --file \"src/widget.js\"`.","For project-wide suppression use ignore-rule: `hooks ignore-rule <rule>`, or `hooks ignore-rule overused-font --all-values` for the value-specific rule.","If you only care about one concrete value, pass that value instead of `*`."],"exampleFix":"# before\nimpeccable hooks ignore-value design-system-font-size \"*\"\n\n# after\nimpeccable hooks ignore-value design-system-font-size \"*\" --file \"src/widget.js\"\nimpeccable hooks ignore-rule design-system-font-size   # if project-wide is truly wanted","handlingStrategy":"validation","validationCode":"function planIgnore(rule, value, scope) {\n  if (value === '*' && !scope) {\n    if (!rule) throw new Error('rule required');\n    return ['hooks', 'ignore-rule', rule, ...(rule === 'overused-font' ? ['--all-values'] : [])];\n  }\n  return ['hooks', 'ignore-value', rule, value, ...(scope ? ['--file', scope] : [])];\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat a bare '*' value as a smell: either scope it with --file or escalate to ignore-rule.","Remember overused-font additionally needs --all-values on the ignore-rule path."],"tags":["cli","guard-rail","wildcard-scope","hook-admin","ignore-value"],"backgroundTag":"wildcard-requires-scope","analyzedSha":"f88b2837a7d7c3182e46307bbbb091a1ed547571","analyzedAt":"2026-08-18T04:58:36.608Z","contentChangedAt":"2026-08-18T04:58:36.608Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}