Skip to content

Commit 7739129

Browse files
authored
eslint: prevent async forEach(callbackFn) (#1669)
Closes getodk/central#1456
1 parent a50046d commit 7739129

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.eslintrc.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
"no-multiple-empty-lines": "off",
3030
"no-nested-ternary": "off",
3131
"no-only-tests/no-only-tests": [ "error", { "block": [ "describe", "it", "describeMigration" ] } ],
32-
"no-restricted-syntax": "off",
32+
"no-restricted-syntax": [ "error",
33+
{
34+
"message": "Do not use async functions in .forEach()",
35+
"selector": "CallExpression[callee.property.name='forEach'] > :matches(ArrowFunctionExpression, FunctionExpression)[async=true].arguments"
36+
}
37+
],
3338
"no-underscore-dangle": "off",
3439
"nonblock-statement-body-position": "off",
3540
"object-curly-newline": [ "error", {

0 commit comments

Comments
 (0)