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.
Rationale
Resolves #151. This makes it so a promise must be awaited (or otherwise handled, just not ignored) in Angular tests, making them match other code.
Resolves #115. This makes it so a function marked
async
mustawait
something, not contain only synchronous code and not return a promise.Implementation
no-floating-promises
in Angular tests. See PR comment for rationale for keepingno-unbound-method: 'off'
here.no-return-await: 'off'
in the JS ruleset. This rule is now deprecated by ESLint because returning an awaited promise is no longer a performance concern.@typescript-eslint/return-await': 'error'
was already enabled and is still useful because it enforces the inverse, that you should await promises rather than just return them because you get better stack traces'require-await': 'error'
in the JS ruleset and'@typescript-eslint/require-await': 'error'
in the TS-with-typechecking ruleset.minor
in accordance with CONTRIBUTING.md guidance for rule changes and include package-specific descriptions of the changesTesting
A draft PR into
systemlink-lib-angular
shows the impact of some of these changes. It requires mostly mechanical changes and catches lots of legitimate issues.I also updated a couple test files in this repo to include more async cases and played around with those implementations locally to verify the rules were working.