Skip to content
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

Check throw Object.assign(Error('...'), ...) in throw-new-error #2320

Closed
fisker opened this issue Apr 12, 2024 · 0 comments · Fixed by #2332
Closed

Check throw Object.assign(Error('...'), ...) in throw-new-error #2320

fisker opened this issue Apr 12, 2024 · 0 comments · Fixed by #2332

Comments

@fisker
Copy link
Collaborator

fisker commented Apr 12, 2024

Sometimes it's useful to attach additional information to the error, so I use throw Object.assign(Error('...'), ...). throw-new-error should report on this use case.

I haven't checked, but other error related rules like prefer-type-error, error-message should aware this pattern too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants