pbakaus/impeccable · error
Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks i
Error message
Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks ignore-value overused-font Inter What it means
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.
Source
Thrown at plugin/skills/impeccable/scripts/hook-admin.mjs:697
}
const [rule, ...valueParts] = positionals;
return {
rule: String(rule || '').trim().toLowerCase(),
value: normalizeIgnoreValue(valueParts.join(' ')),
// Sorted: the dedup key compares the files array, so an unsorted scope made
// `--file b.css --file a.css` a different entry from `--file a.css --file b.css`.
files: Array.from(new Set(files.filter(Boolean))).sort(),
shared,
local,
reason,
};
}
function addIgnoreValue(cwd, args) {
const parsed = parseIgnoreValueArgs(args);
if (!parsed.rule || !parsed.value) {
throw new Error(`Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks ignore-value overused-font Inter`);
}
if (parsed.shared && parsed.local) {
throw new Error('Pass only one scope flag: --shared or --local');
}
// A bare `*` would suppress the rule everywhere, which is ignore-rule's job and
// not what a finding in one file justifies. detector.ignoreValues honours a
// `files` scope, so require one — matching `impeccable ignores add-value`.
if (parsed.value === '*' && parsed.files.length === 0) {
// `ignore-rule overused-font` refuses on its own without --all-values, so
// naming the bare form here would hand the user a second error.
const projectWide = parsed.rule === 'overused-font'
? `${IMPECCABLE_COMMAND} hooks ignore-rule ${parsed.rule} --all-values`
: `${IMPECCABLE_COMMAND} hooks ignore-rule ${parsed.rule}`;
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}.`);
}
View on GitHub (pinned to d14711ae3d)
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.
Example fix
# before impeccable hooks ignore-value overused-font # after impeccable hooks ignore-value overused-font Inter
Defensive patterns
Strategy: validation
Validate before calling
if (!parsed.rule || !parsed.value) {
throw new Error('Pass a rule id and value, e.g. /impeccable hooks ignore-value overused-font Inter');
} Type guard
function hasRuleAndValue(parsed) {
return typeof parsed.rule === 'string' && parsed.rule !== ''
&& typeof parsed.value === 'string' && parsed.value !== '';
} Prevention
- Supply both a rule id and a value positional for value-specific rules.
- When automating, assert both positionals are non-empty before invoking.
When it happens
Trigger: Running `hooks ignore-value overused-font` (rule present, value missing) or `hooks ignore-value` (both missing); supplying only flags.
Common situations: Forgetting the value half of a value-specific rule; a script that drops the value under some path.
Related errors
- Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule
- Pass a glob, e.g. ${IMPECCABLE_COMMAND} hooks ignore-file "s
- Unknown ignore-rule flag: ${arg}
- overused-font is value-specific by default. Use ${IMPECCABLE
- --reason is not supported for ignore-file because detector.i
AI-assisted analysis of pbakaus/impeccable@d14711ae3d (2026-08-13).
Data as JSON: /api/errors/61062f5e3a434977.
Report an issue: GitHub.