no-throw-literal: confusing error message when throwing object literal #11637
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
rule
Relates to ESLint's core rules
Tell us about your environment
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Here is an example of the problem where a object literal is thrown:
What did you expect to happen?
I think the wording of the reported message is very confusing because in my example I did throw an object. I would expect a message like
Unexpected object literal thrown.
orExpected an error object to be thrown.
.What actually happened? Please include the actual, raw output from ESLint.
The reported problem message is
Expected an object to be thrown.
.Are you willing to submit a pull request to fix this bug?
Yes. However I’m not completely sure if this will be considered as a bug or as a breaking change.
The text was updated successfully, but these errors were encountered: