59 bytes, text/x-review-board-request
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)
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 email@example.com: https://hg.mozilla.org/integration/autoland/rev/6dab94af60d4 Enable no-array-constructor across mozilla-central r=standard8
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.