-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add suggestion for no-return-await (#16637)
* refactor: extract error list into a function Suggestions will be different for different errors, so a constant object won't work anymore * feat: suggest removing await in no-return-await * Fix suggestion message Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * refactor: remove unused data * fix: only trim after await if there is a space * refactor: allow expecting no suggestion * refactor: move code for fixing into fix function * fix: do not suggest a fix if await and awaited expression are not on th same line * Simplify suggestion message Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Simplify single-character access Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Simplify removing a range Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * feat: suggest removing await when expression starts with ( * refactor: use awaitToken to determine await range * fix: use more performant way to identify tokens Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
- Loading branch information
1 parent
ba74253
commit 075ef2c
Showing
2 changed files
with
168 additions
and
32 deletions.
There are no files selected for viewing
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
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