You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The require-json-parse-try-catch rule (actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.ts) only matches a CallExpression whose callee is a directMemberExpression with object.name === "JSON" and a non-computed property.name === "parse". Any indirect reference to JSON.parse bypasses the rule entirely, so an unguarded parse can ship without a warning.
Missed patterns (false negatives)
Computed access: JSON["parse"](raw) — property is a string Literal, not an Identifier, so the property.type !== "Identifier" guard returns early.
A grep of actions/setup/js/*.cjs shows 0 current indirect usages, so this is preventive hardening rather than a live regression — but the gap means the rule silently under-reports the moment such code is introduced.
Acceptance criteria
Rule reports JSON["parse"](x) (computed member with a "parse" string-literal key) when not inside a protecting try block.
Decide and document handling of aliased/destructured bindings: implement scope-based tracking of JSON.parse aliases, OR explicitly document them as out of scope with a code comment and a follow-up note.
Add fixture/unit tests covering: computed access flagged; computed access inside try not flagged; (if implemented) aliased and destructured bindings.
No new false positives on the existing 107 JSON.parse call sites in actions/setup/js.
Notes
Keep the matcher precise: only treat a "parse" member of an object resolving to the global JSON as in scope; do not flag unrelated .parse members (e.g. path.parse, Number.parse*).
Activity
github-actions commentedon Jun 28, 2026
🍪 Issue Monster selected this for Copilot
I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.
If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪
eslint-factory: fix require-json-parse-try-catch to handle computed J…
github-actions commentedon Jul 4, 2026
This issue was automatically closed because it expired on 2026-07-04T22:56:21.473Z.