pbakaus/impeccable · error · Error

Unknown ignore-value flag

Error message

Unknown ignore-value flag: ${arg}

What it means

Thrown while parsing `hooks ignore-value` arguments when a `--`-prefixed token matches none of the supported flags (--shared, --local, --reason, --file, --files and their = forms). The comment in source records the motivating bug: `ignore-value overused-font Inter --shard` stored the value "inter --shard", which matched no finding, and reported success. Unknown flags now throw to prevent that silent no-op.

Solutions

  1. Remove or correct the flag — ignore-value accepts --shared, --local, --reason, --file, --files only.
  2. If you meant whole-rule suppression, use `hooks ignore-rule <rule>` instead.
  3. If you meant --file for scoping, check the spelling and give it a glob value.

Example fix

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

# after
impeccable hooks ignore-value overused-font Inter --file "src/marketing/**"
Defensive patterns

Strategy: validation

Validate before calling

const IGNORE_VALUE_FLAGS = ['--shared', '--local', '--reason', '--file', '--files'];
function isKnownIgnoreValueFlag(a) {
  return IGNORE_VALUE_FLAGS.includes(a) || IGNORE_VALUE_FLAGS.some(f => a.startsWith(f + '='));
}
if (args.some(a => a.startsWith('--') && !isKnownIgnoreValueFlag(a))) {
  throw new Error(`unknown ignore-value flag; allowed: ${IGNORE_VALUE_FLAGS.join(', ')}`);
}

Prevention

When it happens

Trigger: `hooks ignore-value overused-font Inter --shard` (typo); `--files=` misspellings like `--filez`; carrying --all-values over from ignore-rule (it is not valid here); agents inventing flags like --global or --force.

Common situations: Autocomplete or muscle memory from the sibling subcommands; scripted flag sets shared across ignore-rule/ignore-file/ignore-value despite different vocabularies per subcommand.

Related errors


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

Appendix: source

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