Closed
Bug 1578190
Opened 2 years ago
Closed 2 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
(Firefox Build System :: Lint and Formatting, task, P3)
Firefox Build System
Lint and Formatting
Tracking
(firefox71 fixed)
RESOLVED
FIXED
mozilla71
| Tracking | Status | |
|---|---|---|
| firefox71 | --- | fixed |
People
(Reporter: standard8, Assigned: MonikaMaheshwari)
References
(Blocks 1 open bug)
Details
Attachments
(1 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•2 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•2 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 2 years ago
status-firefox71:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in
before you can comment on or make changes to this bug.
Description
•