Closed Bug 1368041 Opened 8 years ago Closed 7 years ago

Enable no-array-constructor across mozilla-central

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

3 Branch
enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: standard8, Assigned: dbugs, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

Attachments

(1 file)

From eslint.org: Use of the Array constructor to construct a new array is generally discouraged in favour of array literal notation because of the single-argument pitfall and because the Array global may be redefined http://eslint.org/docs/rules/no-array-constructor Hence, we should enable the no-array-constructor across mozilla-central. The rule is already enabled for some areas: https://dxr.mozilla.org/mozilla-central/search?q=no-array-constructor&redirect=false I'm willing to mentor this bug. Approximate steps: - Ensure you've got ESLint setup on mozilla-central (https://developer.mozilla.org/docs/ESLint). - In tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js un-comment the no-array-constructor line. - Remove the no-array-constructor lines from the other .eslintrc.js files (* apart from devtools/ *) - Run: ./mach eslint - Fix the 30 or so instances that it reports as failing. I think all of these should just be switching the `new Array()` to `[]`. - Commit to a patch and push it to mozreview (http://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview.html)
Assignee: nobody → dbugs
Can I work on this bug as one of my starting bugs ? If so, I'd like to start working unless Dan has already started working. Thanks - Kushal
(In reply to Kushal Singh from comment #2) > Can I work on this bug as one of my starting bugs ? If so, I'd like to start > working unless Dan has already started working. Hi, Dan has already started working on this (and attached a patch). I'll probably have similar bugs available later today or tomorrow, so keep an eye out if you're looking for more.
Comment on attachment 8872040 [details] Bug 1368041 - Enable no-array-constructor across mozilla-central https://reviewboard.mozilla.org/r/143558/#review147846 Looks good. r=Standard8 Thank you!
Attachment #8872040 - Flags: review?(standard8) → review+
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6dab94af60d4 Enable no-array-constructor across mozilla-central r=standard8
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Testing → Firefox Build System
Keywords: good-first-bug
Version: Version 3 → 3 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: