eslint-community / eslint-plugin-promise

Enforce best practices for JavaScript promises

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prefer-await-to-then should flag promise.catch/finally as well

jp7837 opened this issue · comments

Description

For consistency, I feel that the prefer-await-to-then rule should also flag promise.catch and promise.finally so we can enforce async/await everywhere if desired.

Steps to Reproduce

  1. Run prefer-await-to-then on code with a Promise.prototype.catch invocation

Expected behavior: catch call is flagged

Actual behavior: rule does not report a problem

Versions

[Please fill this in if you are submitting a bug report]

  • Node version: 12.16.1
  • ESLint version: 6.7.2
  • eslint-plugin-promise version: 4.2.1

Additional Information

None, suggestion

If we take this change, we could consider renaming the rule