pbakaus/impeccable · error

${arg} requires a glob

Error message

${arg} requires a glob

What it means

In parseIgnoreValueArgs(), `--file` / `--files` consume the next argv token as a glob. If either flag is the LAST token in argv, there is no following token to consume (i + 1 >= args.length), and the parser throws before calling requireGlob. This is the 'flag present but no value supplied' case, distinct from error 31 (value supplied but empty) and error 32 (value supplied but is a flag).

Source

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

  let local = false;
  let reason = '';

  for (let i = 0; i < args.length; i++) {
    const arg = String(args[i] || '');
    if (arg === '--shared') {
      shared = true;
    } else if (arg === '--local') {
      local = true;
    } else if (arg === '--reason') {
      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(),

View on GitHub (pinned to d14711ae3d)

Solutions

  1. Follow --file/--files with a glob token.
  2. If building argv programmatically, ensure every --file is paired with a value before joining.

Example fix

# before
impeccable hooks ignore-value r v --file

# after
impeccable hooks ignore-value r v --file "src/widget.js"
Defensive patterns

Strategy: validation

Validate before calling

for (let i = 0; i < args.length; i++) {
  if ((args[i] === '--file' || args[i] === '--files') && i + 1 >= args.length) {
    throw new Error(`${args[i]} requires a glob`);
  }
}

Prevention

When it happens

Trigger: Ending the command with a dangling `--file` or `--files`, e.g. `ignore-value r v --file`.

Common situations: Trailing flag with no argument; a script that appends `--file` conditionally but drops its value.

Related errors


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