pbakaus/impeccable · error

Unknown ignore-value flag: ${arg}

Error message

Unknown ignore-value flag: ${arg}

What it means

parseIgnoreValueArgs() has a fixed flag set: `--shared`, `--local`, `--reason`/`--reason=`, and `--file`/`--files`/`--file=`/`--files=`. Any other `--` token is rejected so a typo cannot fold into the stored value (the comment cites `--shard` turning value into "inter --shard", matching nothing, yet reporting success).

Source

Thrown at plugin/skills/impeccable/scripts/hook-admin.mjs:675

      const chunks = [];
      while (i + 1 < args.length && !String(args[i + 1]).startsWith('--')) {
        chunks.push(args[++i]);
      }
      reason = chunks.join(' ').trim();
    } else if (arg.startsWith('--reason=')) {
      reason = arg.slice('--reason='.length).trim();
    } else if (arg === '--file' || arg === '--files') {
      if (i + 1 >= args.length) throw new Error(`${arg} requires a glob`);
      files.push(requireGlob(args[++i], arg));
    } else if (arg.startsWith('--file=')) {
      files.push(requireGlob(arg.slice('--file='.length), '--file'));
    } else if (arg.startsWith('--files=')) {
      files.push(requireGlob(arg.slice('--files='.length), '--files'));
    } else if (arg.startsWith('--')) {
      // Otherwise a typo folds into the value: `ignore-value overused-font Inter
      // --shard` stored the value "inter --shard", which matches no finding, and
      // reported success. Matches `impeccable ignores add-value`.
      throw new Error(`Unknown ignore-value flag: ${arg}`);
    } else {
      positionals.push(arg);
    }
  }

  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,
  };
}

View on GitHub (pinned to d14711ae3d)

Solutions

  1. Use only the accepted ignore-value flags: --shared, --local, --reason [text], --file/--files <glob>.
  2. Check the spelling of scope flags (--shared, not --shard/--global).

Example fix

# before
impeccable hooks ignore-value overused-font Inter --shard

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

Strategy: validation

Validate before calling

const IGNORE_VALUE_FLAGS = new Set(['--shared', '--local', '--reason', '--file', '--files']);
function isKnownIgnoreValueFlag(a) {
  return IGNORE_VALUE_FLAGS.has(a) || a.startsWith('--reason=') || a.startsWith('--file=') || a.startsWith('--files=');
}
for (const a of args) {
  if (String(a).startsWith('--') && !isKnownIgnoreValueFlag(a)) {
    throw new Error(`Unknown ignore-value flag: ${a}`);
  }
}

Type guard

function isKnownIgnoreValueFlag(arg) {
  return ['--shared','--local','--reason','--file','--files'].includes(arg)
    || arg.startsWith('--reason=') || arg.startsWith('--file=') || arg.startsWith('--files=');
}

Prevention

When it happens

Trigger: Running `hooks ignore-value <rule> <value>` with a misspelled or wrong-subcommand flag such as `--shard`, `--global`, or `--all-values`.

Common situations: Typing `--shared` as `--shard`; reaching for a flag from ignore-rule; stale docs.

Related errors


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