-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: Enforce the use of ReanimatedError instead of Error #6454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's just work on some of these TODOs first.
I recall having some issues with Jest hanging on ESLint unit tests. From what I remember I wasn't able to solve it back in the day though. You can run Jest from the JavaScript debug terminal and, if you have source maps generated, the breakpoints will work - hope this piece of info is going to be helpful 🤞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Thanks for suggestion about fixing tests. I spent some time looking into a potential cause of the issue, tried upgrading I will merge this PR for now and look into the issue later on, since it seems to be better to solve it separately from this PR that just adds a new rule and doesn't break test which already don't work. |
Summary
This PR adds eslint rule that will enforce the use of the new
ReanimatedError
in favor ofError
in the library source files.Example image
Test plan
Just try to use
throw new Error
inside thepackages/react-native-reanimated
instead ofthrow new ReanimatedError
and see that eslint complains about incorrect usage.