pbakaus/impeccable · error · Error

Pass a rule id and value, e.g.

Error message

Pass a rule id and value, e.g. ${IMPECCABLE_COMMAND} hooks ignore-value overused-font Inter

What it means

Thrown by addIgnoreValue when either the rule id or the value is missing after parsing `hooks ignore-value` arguments. Positionals are split as [rule, ...valueParts] and the value is the whitespace-joined, normalized remainder, so the command needs at least two positional tokens: a kebab-case rule id and the offending value (font family, color, size). Without both, no meaningful ignore entry can be written.

Solutions

  1. Pass rule then value: `hooks ignore-value overused-font Inter`.
  2. Copy both halves from the detector finding output (rule id and the exact value it flagged).
  3. If you only want rule-level suppression, use the ignore-rule subcommand instead.

Example fix

# before
impeccable hooks ignore-value overused-font

# after
impeccable hooks ignore-value overused-font Inter
Defensive patterns

Strategy: validation

Validate before calling

function parseInvocation(tokens) {
  const pos = tokens.filter(t => !t.startsWith('--'));
  if (pos.length < 2) throw new Error('ignore-value needs <rule> and <value> positionals');
  return { rule: pos[0], value: pos.slice(1).join(' ') };
}

Prevention

When it happens

Trigger: `hooks ignore-value overused-font` (rule but no value); `hooks ignore-value` bare; `hooks ignore-value Inter` (value given but no rule id, so 'inter' is treated as the rule and the value is empty); all tokens consumed by flags so positionals is empty.

Common situations: Users pasting only the rule half of a suggested command; agents relaying a finding but dropping the value; assuming the rule alone is enough because ignore-rule works that way.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pbakaus/impeccable@f88b2837a7 (2026-08-18). Data as JSON: /api/errors/acef50b901b283cf. Report an issue: GitHub.

Appendix: source

Thrown at skill/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 f88b2837a7)