Skip to content
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

Enable and apply ESLint Jest rules #3270

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

KristjanESPERANTO
Copy link
Contributor

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? 🙂

@KristjanESPERANTO KristjanESPERANTO marked this pull request as ready for review November 20, 2023 18:48
@khassel
Copy link
Collaborator

khassel commented Nov 20, 2023

Thanks, LGTM!

Will merge it if @rejas has no complaints ...

@rejas
Copy link
Collaborator

rejas commented Nov 20, 2023

No complaints

@khassel khassel merged commit 7098f1e into MagicMirrorOrg:develop Nov 20, 2023
6 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the eslintjest branch November 20, 2023 19:12
@KristjanESPERANTO
Copy link
Contributor 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.

@khassel
Copy link
Collaborator

khassel commented Nov 20, 2023

is your work here?

@KristjanESPERANTO
Copy link
Contributor 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 npm run test:js.

@KristjanESPERANTO
Copy link
Contributor 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants