From 3d613e3fa4edac4c46c602f487dc80390582cf5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Jul 2026 07:59:50 +0000 Subject: [PATCH 1/2] Initial plan From a7e12471f7dc1e1d153b30ee18e24f5c90f118cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:11:42 +0000 Subject: [PATCH 2/2] chore: remove withinDeferredBoundary dead code in require-execsync-try-catch rule Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../src/rules/require-execsync-try-catch.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/eslint-factory/src/rules/require-execsync-try-catch.ts b/eslint-factory/src/rules/require-execsync-try-catch.ts index 092e642ae3e..fe0a8374484 100644 --- a/eslint-factory/src/rules/require-execsync-try-catch.ts +++ b/eslint-factory/src/rules/require-execsync-try-catch.ts @@ -1,5 +1,5 @@ import { AST_NODE_TYPES, ESLintUtils, TSESLint, TSESTree } from "@typescript-eslint/utils"; -import { buildTryCatchSuggestion, findEnclosingStatement, isDeferredCallback, isInsideTryBlock } from "./try-catch-rule-utils"; +import { buildTryCatchSuggestion, findEnclosingStatement, isInsideTryBlock } from "./try-catch-rule-utils"; const createRule = ESLintUtils.RuleCreator(name => `https://github.com/github/gh-aw/tree/main/eslint-factory#${name}`); @@ -145,20 +145,6 @@ export const requireExecSyncTryCatchRule = createRule({ if (!isExecSyncCall(node, sourceCode)) return; if (isInsideTryBlock(sourceCode, node)) return; - // Ignore execSync inside deferred callbacks — the parent try block does not protect them. - // isInsideTryBlock already handles this, but we skip reporting when the node itself is - // inside a deferred callback that has no enclosing try block (same FP-avoidance as other rules). - const ancestors = sourceCode.getAncestors(node); - let withinDeferredBoundary = false; - for (let i = ancestors.length - 1; i >= 0; i--) { - if (isDeferredCallback(ancestors[i])) { - withinDeferredBoundary = true; - break; - } - } - // Still flag it even in deferred callbacks — execSync in async callbacks is still risky. - void withinDeferredBoundary; - const argText = node.arguments.length > 0 ? sourceCode.getText(node.arguments[0]) : ""; const stmt = findEnclosingStatement(sourceCode, node);