pbakaus/impeccable · error · Error

Wildcard value ignores must be scoped with --file <glob>, e.

Error message

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}.

What it means

Thrown by addIgnoreValue() when the value is exactly `*` (wildcard) but no --file glob was supplied. A bare `*` would suppress the rule for every value everywhere, which is the job of ignore-rule, not ignore-value. detector.ignoreValues honors a `files` scope, so Impeccable requires one and points you to ignore-rule for genuine project-wide suppression (with the --all-values variant for overused-font).

Source

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

  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}.`);
  }

  const local = parsed.local;
  const config = mergeDetectorConfig(readRawDetectorConfig(cwd, { local }));
  // Key on the file scope too: the same rule/value legitimately appears more than
  // once with different scopes, and a rule+value-only key overwrote them.
  const key = ignoreValueEntryKey({ rule: parsed.rule, value: parsed.value, files: parsed.files });
  const existing = config.ignoreValues.find((entry) => ignoreValueEntryKey(entry) === key);

  if (existing) {
    if (parsed.reason) existing.reason = parsed.reason;
  } else {
    const entry = {
      rule: parsed.rule,
      value: parsed.value,
    };
    if (parsed.files.length) entry.files = parsed.files;
    entry.createdAt = new Date().toISOString();

View on GitHub (pinned to d14711ae3d)

Solutions

  1. Scope the wildcard to a file glob: `impeccable hooks ignore-value design-system-font-size "*" --file "src/widget.js"`.
  2. For project-wide suppression switch subcommands: `impeccable hooks ignore-rule <rule>` (or `--all-values` for overused-font).
  3. Re-read the suggested command in the error text — it is generated for your specific rule.

Example fix

// before
impeccable hooks ignore-value design-system-font-size "*"
// after
impeccable hooks ignore-value design-system-font-size "*" --file "src/widget.js"
Defensive patterns

Strategy: validation

Validate before calling

if (parsed.value === '*' && parsed.files.length === 0) {
  throw new Error('Wildcard value needs --file <glob>, or use ignore-rule for project-wide');
}

Type guard

function wildcardIsScoped(parsed) {
  return parsed.value !== '*' || parsed.files.length > 0;
}

Prevention

When it happens

Trigger: `impeccable hooks ignore-value overused-font "*"` or `... design-system-font-size "*"` with no `--file`. The error message dynamically suggests the right ignore-rule command, including `--all-values` only for the overused-font rule.

Common situations: Wanting to suppress a value across a file set but quoting `*` as the value instead of as a --file glob, or genuinely wanting project-wide suppression and reaching for the wrong subcommand.

Related errors


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