Created
November 3, 2023 09:14
-
-
Save karlhorky/3ec5d8cd585251a1331fdba95f891928 to your computer and use it in GitHub Desktop.
Avoid await within arrays passed to Promise.all() https://twitter.com/alvarlagerlof/status/1720182566135779582
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://twitter.com/karlhorky/status/1720368118193651903 | |
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.Config} */ | |
const config = { | |
'no-restricted-syntax': [ | |
'warn', | |
{ | |
selector: | |
'CallExpression[callee .object.name=Promise][callee .property.name=all] > ArrayExpression > AwaitExpression', | |
message: 'Avoid await within array passed to Promise.all() to avoid waterfalls', | |
}, | |
], | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment