-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async rule changes #156
Merged
Merged
Async rule changes #156
Conversation
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
jattasNI
requested review from
mure,
rajsite and
TrevorKarjanis
as code owners
September 19, 2024 22:27
rajsite
reviewed
Sep 20, 2024
jattasNI
commented
Sep 20, 2024
rajsite
reviewed
Sep 20, 2024
rajsite
approved these changes
Sep 20, 2024
Co-authored-by: Milan Raj <[email protected]>
Co-authored-by: Milan Raj <[email protected]>
TrevorKarjanis
approved these changes
Sep 25, 2024
mure
approved these changes
Sep 26, 2024
rajsite
approved these changes
Sep 26, 2024
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.
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.jasminewd2
types. I fixed those by usingjasmine
types instead (and fixing a playwright test that was incorrectly referencing jasmine types).npmrc
since my dev machine is configured to use Artifactoryno-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.