Enable no-throw-literal eslint rule in the entire tree
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: Gijs, Assigned: Kwan)
References
Details
Attachments
(1 file)
Because `throw "Foo"` isn't as good as `throw new Error("Foo")`
eslint has a builtin rule for this:
http://eslint.org/docs/rules/no-throw-literal
It seems to already be enabled for toolkit/components/extensions and devtools. I think we should enable it everywhere.| Assignee | ||
Comment 1•2 years ago
|
||
I have this done locally, modulo a couple test errors https://treeherder.mozilla.org/#/jobs?repo=try&revision=b3dfb79d3e8722b1e5cc8297ebef3eaf4b59cbe9
Also have a new rule to forbid and autofix throw Cr.NS_ERROR;, since no-throw-literals can't detect that's just an int.
| Assignee | ||
Comment 2•2 years ago
|
||
| Assignee | ||
Comment 3•2 years ago
|
||
Green try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=724b6b5b589c944a265509a5254511ca29117a5
Sheriffs, this patch may have some dependent patches on Lando when you get to this, but they'll be attached to other bugs so they won't need landing, only this one at the bottom of the stack
https://lando.services.mozilla.com/D24088/
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/13e9a230eb25
Enable ESLint rule no-throw-literal by default. r=Standard8
| Assignee | ||
Updated•2 years ago
|
Comment 5•2 years ago
|
||
| bugherder | ||
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/470f4c1ed97e Port bug 1246594 - Enable ESLint rule no-throw-literal by default; rs=bustage-fix DONTBUILD
Updated•2 years ago
|
Description
•