Skip to content

Instantly share code, notes, and snippets.

@karlhorky
Created November 3, 2023 09:14
Show Gist options
  • Save karlhorky/3ec5d8cd585251a1331fdba95f891928 to your computer and use it in GitHub Desktop.
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
// 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