-
Notifications
You must be signed in to change notification settings - Fork 150
Remove prefer-expect-query-by
rule from shareable configs
#59
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
Comments
Do you know what the confusion is about? Is the doc not clear enough? The main use case is when asserting that an element is not in the document, in which case it's recommended to use Anyway, it's fine for me to not have it enabled by default, I'm just curious to know what people find confusing about it. |
I found this chat in spectrum about it: https://spectrum.chat/testing-library/general/prefer-expect-query-by-linting-rule~802a01db-1afd-4ca3-b753-1dfcfcc5d1ca After that, I discussed with @thomlom about the rule and we agreed it looks too opinionated to be enabled by recommended preset. Then I shared with some coworkers and they found it as a weird rule by default too: the main though was "I completely understand how all recommended rules would help me writing testing library tests but not this one in particular". About if doc is clear enough or not, examples could be improved and I would leave clear what use cases for this rules are (adding link to jest-dom section in testing library doc would help). If you have anything else in mind we could improve here, let me know. I'll create a PR soon so we can improve it there too. |
I see, thanks for the clarification. Yeah let's do it like this then. |
I guess that ideally we could have a rule enabled by default that forces you to use |
Closed by #60 |
@emmenko By the way: as discussed with Kent C in twitter, probably this rule should evolve to something that prevents using Would be a good addition for future versions. |
Yeah definitely! Let's track this as an issue first. |
I'm creating an issue so we can discuss further details there. |
After checking
prefer-expect-query-by
rule with different people and getting different feedback about it, this rule is definitely too opinionated to be enabled by default in shareable configs. Also, the motivation of the rule is not really clear, so we need to improve the rule doc to clarify what's the use case and corresponding motivation for it.The text was updated successfully, but these errors were encountered: