pbakaus/impeccable · error · Error

Unknown ignore-rule flag: ${arg}

Error message

Unknown ignore-rule flag: ${arg}

What it means

Thrown by parseIgnoreRuleArgs when an argument starts with '--' but is not one of the recognized ignore-rule flags (--all-values, --reason, --reason=<...>). ignore-rule stores rule ids only, so its flag surface is intentionally tiny; unknown flags are rejected rather than silently dropped. Notably --shared/--local belong to ignore-file, not ignore-rule.

Source

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

function normalizeRuleId(rule) {
  return String(rule || '').trim().toLowerCase();
}

function parseIgnoreRuleArgs(args) {
  const positionals = [];
  let allValues = false;

  for (let i = 0; i < args.length; i++) {
    const arg = String(args[i] || '');
    if (arg === '--all-values') {
      allValues = true;
    } else if (arg === '--reason') {
      while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) i++;
    } 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.`);
  }

View on GitHub (pinned to d14711ae3d)

Solutions

  1. For ignore-rule, use only --all-values (and optionally --reason <text>).
  2. If you meant to scope to files, use ignore-file with a glob instead.
  3. If you meant a value-specific exception, use ignore-value <rule> <value>.

Example fix

# before
impeccable hooks ignore-rule side-tab --shared

# after (ignore-rule has no scope flag)
impeccable hooks ignore-rule side-tab
# to scope to files instead:
impeccable hooks ignore-file "src/legacy/**"
Defensive patterns

Strategy: validation

Validate before calling

// Validate ignore-rule args before dispatch.
const RULE_FLAGS = new Set(['--all-values', '--reason']);
function validateIgnoreRuleArgs(args) {
  for (const a of args) {
    if (a.startsWith('--') && !RULE_FLAGS.has(a) && !a.startsWith('--reason=')) {
      throw new Error(`Unknown ignore-rule flag: ${a}`);
    }
  }
}

Prevention

When it happens

Trigger: Passing --shared or --local to ignore-rule (they are ignore-file scope flags); passing --force, --recursive, or a typo like --all-val; passing a flag meant for ignore-value.

Common situations: Copy-pasting flags from an ignore-file command; assuming ignore-rule and ignore-value share the same flag surface; a typo.

Related errors


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