Skip to content

eslint-factory: exclude vendored/generated files from custom rule linting (work_queue_yaml.cjs) #74386

Done

Description

@github-actions

Problem

eslint-factory/eslint.config.cjs applies every gh-aw-custom/* rule to all of actions/setup/js/**/*.cjs, with the only ignores entry being test files:

{
  files: ["*.cjs", "**/*.cjs"],
  ignores: ["**/*.test.cjs", "**/*.test.js"],
  ...
}

actions/setup/js/work_queue_yaml.cjs is vendored, generated code — it opens with:

// @ts-nocheck
// Generated by scripts/work_queue_yaml/build.mjs from [email protected].
// This self-contained module is copied with queue scripts; no runtime npm packages.

It is a byte-for-byte copy of the upstream [email protected] package, regenerated by scripts/work_queue_yaml/build.mjs. None of its code is team-authored, and "fixing" a lint warning in it by hand would just be overwritten on the next regeneration (or silently diverge from upstream).

Grounded finding

First-ever review of no-deprecated-string-substr (new since the last refiner run; index.ts rule count went 69 → 71 this run, the other new rule being no-dynamic-string-replacement). The rule itself is correct and simple — it flags any .substr(...) call — but grepping live, non-test call sites in actions/setup/js turns up 13 hits, all inside work_queue_yaml.cjs:

13 live .substr() call sites, all in the vendored yaml.cjs
work_queue_yaml.cjs:998   const code = json.substr(i + 2, 4);
work_queue_yaml.cjs:1025  if (code.substr(0, 2) === "00") str += "(x/redacted)" + code.substr(2);
work_queue_yaml.cjs:1026  else str += json.substr(i, 6);
work_queue_yaml.cjs:2044  lines[i] = str.substr(o, lineWidth);
work_queue_yaml.cjs:2248  return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
work_queue_yaml.cjs:2420  const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0;
work_queue_yaml.cjs:3635  const raw = source.substr(i - 1, 2);
work_queue_yaml.cjs:3689  const cc = source.substr(offset, length);
work_queue_yaml.cjs:3694  const raw = source.substr(offset - 2, length + 2);
work_queue_yaml.cjs:4325  const dt = this.buffer.substr(offset, 3);
work_queue_yaml.cjs:4351  return this.buffer.substr(this.pos, n);
work_queue_yaml.cjs:4672  yield this.buffer.substr(this.pos, n);
work_queue_yaml.cjs:4746  yield this.buffer.substr(this.pos, n);

Every one of these is a true positive for the rule (real .substr() on a string), but every one is also unactionable noise: this file isn't hand-maintained, so the "fix" is to patch an upstream npm package and regenerate, not to edit the warning away locally. Since work_queue_yaml.cjs is a large (4700+ line) full YAML parser full of imperative string/regex manipulation and try/catch, it is very likely other gh-aw-custom/* rules also fire inside it, multiplying the same unactionable-noise problem across the whole rule set — this issue only audited the substr angle because that's the rule under first review this run.

Acceptance criteria

  • eslint-factory/eslint.config.cjs gains an ignores entry (alongside the existing **/*.test.cjs/**/*.test.js entries) that excludes vendored/generated files — either by exact path (actions/setup/js/work_queue_yaml.cjs) or, more durably, by detecting the existing // Generated by vendoring marker convention so future vendored drops are covered automatically without another manual config edit.
  • Re-running npm run lint:setup-js produces zero gh-aw-custom/* diagnostics for work_queue_yaml.cjs.
  • A regression test or config-level check (e.g. a small vitest case asserting the ignores glob matches the file) so the exclusion can't silently regress.
  • No change to how **/*.test.cjs is already ignored.

Notes

  • no-dynamic-string-replacement (the other new rule this run) was also reviewed. Its pattern-must-be-a-literal scope limit is real and documented in its own test suite (s.replace(pat, value); is an explicit valid case), but the two live non-literal-pattern call sites found this run (generate_safe_outputs_tools.cjs:171, redact_cli_proxy_diagnostics.cjs:48) are both confounded — the first's candidate replacement values are static constants with no $ characters, and the second's replacement is an intentional $1-capture-group template (start_mcp_gateway.cjs:411-412), not an accidental dynamic-value injection. Not filed; no clean misfire found.
  • Open-issues backlog for label:eslint-factory confirmed at zero before filing (verified via items[0].total_count, not the outer total_count, per this workflow's documented API-quirk note).

Generated by 🤖 ESLint Refiner · claude · agent · ~171 AIC · ⌖ ~1 AIC · ⊞ 4.1K · ◷
Claim finished

  • expires on Nov 9, 2026, 8:12 PM UTC-08:00

Activity

  1. added
    cookie
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cookieeslint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions