Closed
Bug 1578190
Opened 7 years ago
Closed 7 years ago
Add a rule to enable linting for `!foo.length` and `if (foo.length)` over `if (foo.length == 0)` and `if (foo.length > 0)` etc.
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox71 fixed)
RESOLVED
FIXED
mozilla71
| Tracking | Status | |
|---|---|---|
| firefox71 | --- | fixed |
People
(Reporter: standard8, Assigned: MonikaMaheshwari)
References
Details
Attachments
(1 external file)
Branching out from bug 1552055 so that we can land the actual rule addition (but not enable it). See that bug for more discussion.
+++ This bug was initially created as a clone of Bug #1552055 +++
Our guidelines are fairly clear that if (!foo.length) is preferred over if (foo.length == 0) (and ditto for the "positive" ie non-0 length case), we should have an eslint rule (w/ --fix functionality) to enforce this.
| Assignee | ||
Comment 1•7 years ago
|
||
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f9bcfe969f6b
Add a rule to ensure 'if(foo.length)' instead of 'foo.length>0'. r=Standard8
Comment 3•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox71:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Updated•4 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•