-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add no-failing-hooks
rule
#108
Comments
Why would anyone want to have a failing hook? I kinda think we should just disallow it in AVA until someone complains with a good use-case. We should strive to keep AVA as sensible as possible. ESLint rules are purely for situations where we can't. |
My thought was some an As the PR stands now, it allows any use. If someone comes up with a valid reason to use it in a It's niche enough, I'm willing to let it go though. |
If someone does, we could easily change to allow it in AVA too, but allowing it without any real-world use-cases we end up having a linter rule for something I see no use-case for. I might be wrong. I just don't like doing stuff for hypothetical reasons. @novemberborn @vdemedes @sotojuan Thoughts? |
Well, we will probably do this linter rule regardless of what we do in AVA right? For early feedback in atom? |
Right, yeah. |
Happy to disallow in AVA too. |
Closing this in favor of #186, which will restrict modifier chaining for many other things too. In the latest AVA 1.0.0 beta, |
While the
failing
modifier could technically be used for a hook (avajs/ava#831 (comment)), it's probably a mistake in most cases.Rather than outlawing it in AVA, I think it would be best to make a rule here that defaults to an
error
if they use thefailing
modifier on any hooks (before
,beforeEach
,after
, etc.). Users can then disable with a eslint comment if they really meant to do it.Optionally, we could add an
allowedHooks
config option.Perhaps it's not even worth doing this, since the intent is to have AVA print the failing tests in red eventually (which should be warning enough, even if it is in a hook).
The text was updated successfully, but these errors were encountered: