prefer-await-to-callbacks
UnreleasedConfiguration
Prefer async/await to callback patterns.
Rule Details
This rule reports calls to identifiers named cb or callback, function
parameters with either name in the last position, and calls whose last argument
is a function or arrow function with a first parameter named err or error.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The last-argument check allows on and once listeners and the array methods
map, every, forEach, some, find, and filter with one argument. It also
allows those methods with two arguments on lodash, underscore, or _, and
direct calls to those method names with two arguments.
Callbacks within an await or yield expression are exempt from the
last-argument check. Direct cb/callback calls and last parameters with those
names are still reported in those contexts.
This rule has no options and provides no automatic fixes or suggestions.