-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow addditional assert function names with expect-expect
#155
Allow addditional assert function names with expect-expect
#155
Conversation
+1 for customized function names for assertions enforcement, that's exactly what I was looking for 🙏 |
@mskelton Can you advise whether this approach is acceptable or if you'd prefer 1:1 parity with the jest plugin's rule configuration? |
Sorry, haven't had a chance for review. I think what I would actually prefer would be to use global settings so that we can share those settings for all rules that are checking expect statements. Similar to this: https://github.com/jest-community/eslint-plugin-jest#aliased-jest-globals |
Sounds good, I'll draft this and hope to return to work on it later this week. |
@mskelton I've got a working implementation based on shared data. However, there are two problems I'd like to clarify:
|
@mskelton Any thoughts regarding my question above? Are you okay with taking the dual approach, allowing for both adding assert function names that should be considered valid in all modules as well as the rule-specific configuration, to allow to extending the list in a given module? |
@sarayourfriend Sorry, I forgot to reply to this thread. I think I agree that doing both is probably best. Global config that can be overridden per rule. |
No worries, thanks for confirming. I'll try to have the PR ready be the end of the week. |
This PR should be ready for another review @mskelton 🙏 |
Co-authored-by: Mark Skelton <mdskelton99@gmail.com>
@mskelton Your requests are addressed in the most recent commit. |
🎉 This PR is included in version 0.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #154.
This PR does not attempt parity with the
eslint-plugin-jest
rule option. It would not necessarily be difficult to achieve parity. Thejest
plugin is MIT licensed and we could copy/paste the various utility functions from that library to implement a similarly flexible option.I've opted not to do that because this naive approach was very simple to implement and I wanted to get the PR up for it in case it's an acceptable MVP for this change. However, if y'all would like me to extend it to add full parity with the
jest
plugin's rule's options, I am happy to do so, just let me know.