Closed
Bug 1443698
Opened 7 years ago
Closed 7 years ago
Fix & enable ESLint var/let/const rules
Categories
(Tree Management :: Treeherder: Frontend, enhancement, P1)
Tree Management
Treeherder: Frontend
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
To ensure new code conforms to best practices, as well as help catch things like bug 1443667.
Comment 1•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8956683 -
Flags: review?(cdawson)
Comment 2•7 years ago
|
||
Comment on attachment 8956683 [details] [review]
Link to GitHub pull-request: https://github.com/mozilla/treeherder/pull/3310
Thanks for doing this!
Attachment #8956683 -
Flags: review?(cdawson) → review+
Comment 3•7 years ago
|
||
Commits pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/5f9abbf340e80b65a3a2f6928abdc261b69a3bb5
Bug 1443698 - Fix/enable eslint 'no-multi-assign'
https://eslint.org/docs/rules/no-multi-assign
https://github.com/mozilla/treeherder/commit/9b55b0cfd724e489886a800244baf36a87bda3df
Bug 1443698 - Fix/enable eslint 'no-redeclare'
https://eslint.org/docs/rules/no-redeclare
https://github.com/mozilla/treeherder/commit/c26056dc23322a7f382daed6b7d58f4d260bbe84
Bug 1443698 - Fix/enable eslint 'prefer-const'
https://eslint.org/docs/rules/prefer-const
Changes performed by `--fix`.
https://github.com/mozilla/treeherder/commit/b152fc04f8451059e8957818ea9f6657528642b8
Bug 1443698 - Fix/enable eslint 'no-use-before-define'
https://eslint.org/docs/rules/no-use-before-define
Three files have been excluded from this rule entirely, since they
would require significant changes that might as well wait until they
are rewritten in React. It's likely these files may also need to be
excluded from future `var` to `let`/`const` conversions as a result.
From the AirBnb style guide GitHub issue comments:
> Some enjoy using hoisting to define helper methods at the bottom of
> the file. This guide discourages relying on hoisting; instead
> suggesting importing the helpers from another file when possible.
https://github.com/mozilla/treeherder/commit/101724445a2a941dd8e727fc8fe3f71b9843a61c
Bug 1443698 - Fix/enable eslint 'no-var' and related
https://eslint.org/docs/rules/no-var
https://eslint.org/docs/rules/one-var-declaration-per-line
https://eslint.org/docs/rules/one-var
https://eslint.org/docs/rules/vars-on-top
https://eslint.org/docs/rules/block-scoped-var
Bulk of the changes performed by `--fix`, with rest by hand.
Assignee | ||
Updated•7 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•