help wantednew rule
Description
The rule name may be named unicorn/prefer-await.
This only applies for ES6 code that have the await keyword available.
Prefer await over Promise#then(), Promise#catch() and Promise#finally()
Prefer using await operator over Promise#then(), Promise#catch() and Promise#finally(), which is easier to write and to read afterwards.
This rule is fixable.
Fail
await doSomething().then(() => {
// …
});
doSomething().then(() => {
// …
});
await doSomething().catch((err) => {
// …
});
doSomething().catch((err) => {
// …
});
Pass
await doSomething();
try {
await doSomething();
} catch (err) {
// …
}