Enable and apply ESLint Jest rules#3270
Merged
khassel merged 2 commits intoMagicMirrorOrg:developfrom Nov 20, 2023
Merged
Conversation
210b788 to
9c8cf45
Compare
9c8cf45 to
41e34c4
Compare
41e34c4 to
12794a9
Compare
khassel
approved these changes
Nov 20, 2023
Collaborator
|
Thanks, LGTM! Will merge it if @rejas has no complaints ... |
Collaborator
|
No complaints |
rejas
approved these changes
Nov 20, 2023
Collaborator
Author
|
If anyone wants to take a look. I've been working on enabling the "jest/expect-expect" and "jest/no-done-callback" rules for a while now and adapting the code accordingly. I haven't come to an acceptable result and am putting it aside. |
Collaborator
|
is your work here? |
Collaborator
Author
|
Ah, that's an attempt that I wasn't happy with either. If you want to investigate this, it might be better to ignore that attempt and change the rules yourself from "off" to "warn" and look at the issues from |
Collaborator
Author
|
In any case, I think it's worth taking a look especially at rule "jest/no-done-callback", because its implementation might help us to avoid problems that we sometimes have with asynchronous code. |
rejas
pushed a commit
that referenced
this pull request
Nov 22, 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.
Jest was in the plugin array of the ESLint configuration, but no rules were enabled. So ESLint hasn't checked any Jest rules yet.
So I activated the recommended Jest rules and added a few more. Then I fixed the issues (mostly automatically). I have deactivated the rules "jest/expect-expect" and "jest/no-done-callback" for the time being, as they would have entailed major changes. I didn't want to make the PR too big.
I'm not a Jest expert, but the changes so far look good to me. What do you think of that @khassel? 🙂