-
Notifications
You must be signed in to change notification settings - Fork 839
EthJS monorepo-wide errors #3879
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Don't be to daunted by the diff, this only replaces This now general error throwing paves the way to update the errors to more specific errors by for instance Have marked the method as deprecated to indicate we want to replace this ASAP. |
acolytec3
left a comment
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.
I haven't reviewed every line but this looks super clean. A few nits about terminology but otherwise great!
| 'no-restricted-syntax': [ | ||
| 'error', | ||
| { | ||
| selector: "ThrowStatement > NewExpression[callee.name='Error']", |
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.
I really like this. Can we do something similar for NoBuffer and get rid of our custom rule?
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.
ChatGPT gives this
{
"rules": {
"no-restricted-globals": [
"error",
{
"name": "Buffer",
"message": "Use Uint8Array or another safer alternative instead of Buffer."
}
]
}
}{
"rules": {
"no-restricted-properties": [
"error",
{
"object": "Buffer",
"message": "Use Uint8Array or another safer alternative instead."
}
]
}
}If we want this I'd like to address that in a "lint cleanup" PR or something like that (I also noticed that it seems that the specific eslint configs within the packages are sometimes ignored, for instance when calling lint:fix on monorepo it seems - could also be checked in that PR).
Co-authored-by: acolytec3 <[email protected]>
18ef8bd to
53528ce
Compare
Part of #3712
This PR:
new Error(to use theEthereumJSErrorwith the default error code (this is deprecated and should be updated to the relevant error rather soon-ish)new Error. It forces us to use the new EthereumJSError and does not allow to createnew Error.Note: I have excluded the
rlppackage from these rules, because it has noutildependency. I have also not included thewalletpackage.