pbakaus/impeccable · error · 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

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.

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 d14711ae3d)

Solutions

  1. Provide both a rule id and a value: `impeccable hooks ignore-value overused-font Inter`.
  2. If you only have a rule id and want to suppress the whole rule, use `impeccable hooks ignore-rule <rule>` instead.
  3. Confirm the rule id is a known detector rule (e.g. overused-font, design-system-font-size) so the value can be matched.

Example fix

// before
impeccable hooks ignore-value overused-font
// after
impeccable hooks ignore-value overused-font Inter
Defensive patterns

Strategy: validation

Validate before calling

const [rule, ...valueParts] = positionals;
const value = valueParts.join(' ').trim();
if (!rule || !value) {
  throw new Error('ignore-value needs both a rule id and a value');
}

Type guard

function hasRuleAndValue(positionals) {
  return positionals.length >= 2 && positionals.every(p => typeof p === 'string' && p.trim() !== '');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


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