Enable eslint rule to disallow awaiting a non-thenable type#2075
Merged
robertbrignull merged 4 commits intomainfrom Feb 15, 2023
Merged
Enable eslint rule to disallow awaiting a non-thenable type#2075robertbrignull merged 4 commits intomainfrom
robertbrignull merged 4 commits intomainfrom
Conversation
aeisenberg
approved these changes
Feb 14, 2023
aeisenberg
reviewed
Feb 14, 2023
| registerErrorStubs([checkForUpdatesCommand], (command) => async () => { | ||
| const installActionName = "Install CodeQL CLI"; | ||
| const chosenAction = await void showAndLogErrorMessage( | ||
| const chosenAction = await showAndLogErrorMessage( |
Contributor
There was a problem hiding this comment.
Interesting. I guess it was never possible to install the cli from this code path. I never tried this out, though so I don't really know.
Thanks for catching this.
Contributor
Author
|
Oh and the CI found more cases which didn't show up locally for whatever reason. I'll look into them tomorrow. |
Contributor
Author
|
I've pushed more linting fixes. I believe all these extra changes are behaviour preserving. |
Contributor
Author
|
Ok, third time's the charm. Had to tix another alert that had been introduced on |
koesie10
approved these changes
Feb 15, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/await-thenable.md
I spotted that VS Code is giving suggestions for this error in the editor but not in CI. I guess it's not included in
@typescript-eslint/recommended. Enabling this eslint rule means we can fix this case and avoid introducing more in the future.I think this fix in
extension.tsis a change of behaviour, because the void operator evaluates the expression and then throws away the result and returnsundefined. So previously thechosenAction === installActionNamecondition was always false.Checklist
ready-for-doc-reviewlabel there.