pbakaus/impeccable · error · Error

Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule

Error message

Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule side-tab

What it means

Thrown by addIgnoreRule when no rule id was supplied (parsed.rule is falsy after normalizeRuleId). ignore-rule requires exactly one positional: the rule id to add to detector.ignoreRules. Running it with only flags, or with no arguments at all, is rejected with a concrete example.

Source

Thrown at skill/scripts/hook-admin.mjs:579

    } else if (arg.startsWith('--reason=')) {
      // Accepted for command symmetry; ignoreRules stores rule ids only.
    } else if (arg.startsWith('--')) {
      throw new Error(`Unknown ignore-rule flag: ${arg}`);
    } else {
      positionals.push(arg);
    }
  }

  return {
    rule: normalizeRuleId(positionals[0]),
    allValues,
  };
}

function addIgnoreRule(cwd, args) {
  const parsed = parseIgnoreRuleArgs(args);
  const rule = parsed.rule;
  if (!rule) throw new Error(`Pass a rule id, e.g. ${IMPECCABLE_COMMAND} hooks ignore-rule side-tab`);
  if (rule === 'overused-font' && !parsed.allValues) {
    throw new Error(`overused-font is value-specific by default. Use ${IMPECCABLE_COMMAND} hooks ignore-value overused-font <font> for a confirmed font, or ${IMPECCABLE_COMMAND} hooks ignore-rule overused-font --all-values only when the user asked to ignore overused fonts generally.`);
  }
  const config = mergeDetectorConfig(readRawDetectorConfig(cwd));
  if (!config.ignoreRules.includes(rule)) config.ignoreRules.push(rule);
  writeDetectorConfig(cwd, config);
  return `Added "${rule}" to detector.ignoreRules. Current: ${config.ignoreRules.join(', ')}`;
}

function parseIgnoreFileArgs(args) {
  const positionals = [];
  let shared = false;
  let local = false;

  for (const raw of args) {
    const arg = String(raw || '');
    if (arg === '--shared') {
      shared = true;

View on GitHub (pinned to d14711ae3d)

Solutions

  1. Pass a rule id as the first positional, e.g. `impeccable hooks ignore-rule side-tab`.
  2. List available rule ids via the detector's rule set if unsure which id to pass.

Example fix

# before
impeccable hooks ignore-rule

# after
impeccable hooks ignore-rule side-tab
Defensive patterns

Strategy: validation

Validate before calling

// Ensure a rule id positional is present before calling addIgnoreRule.
function requireRuleId(positionals) {
  if (!positionals[0]) {
    throw new Error('Pass a rule id, e.g. impeccable hooks ignore-rule side-tab');
  }
  return positionals[0];
}

Prevention

When it happens

Trigger: Running `impeccable hooks ignore-rule` with no positional; passing only --all-values or --reason; a rule id that normalizes to empty.

Common situations: Forgetting the rule id; assuming the command is interactive; a wrapper script that drops the positional.

Related errors


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