Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/daily-github-docs-seo-optimizer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-github-docs-seo-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ strict: true
timeout-minutes: 30
tools:
github: false
bash: false
bash: ["*"]
edit: false
safe-outputs:
mentions: false
Expand Down
13 changes: 2 additions & 11 deletions eslint-factory/src/rules/require-fetch-try-catch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ export const requireFetchTryCatchRule = createRule({
// Check for the directly-awaited inline callback pattern:
// await someWrapper(async () => { await fetch(...) })
// ancestors[i-1] must be the CallExpression, ancestors[i-2] the AwaitExpression.
if (
i >= 2 &&
ancestors[i - 1].type === AST_NODE_TYPES.CallExpression &&
ancestors[i - 2].type === AST_NODE_TYPES.AwaitExpression
) {
if (i >= 2 && ancestors[i - 1].type === AST_NODE_TYPES.CallExpression && ancestors[i - 2].type === AST_NODE_TYPES.AwaitExpression) {
const outerAwait = ancestors[i - 2];
// Now search ancestors outward from i-3 to see if the outer AwaitExpression
// is inside a try block (stopping at the next function boundary).
Expand All @@ -151,12 +147,7 @@ export const requireFetchTryCatchRule = createRule({
}
if (outer.type === AST_NODE_TYPES.TryStatement && outer.handler != null) {
const block = outer.block;
if (
outerAwait.range != null &&
block.range != null &&
outerAwait.range[0] >= block.range[0] &&
outerAwait.range[1] <= block.range[1]
) {
if (outerAwait.range != null && block.range != null && outerAwait.range[0] >= block.range[0] && outerAwait.range[1] <= block.range[1]) {
return true;
}
}
Expand Down