Closed
Bug 1183367
Opened 9 years ago
Closed 9 years ago
We should use eslint to validate frontend js in travis
Categories
(Tree Management :: Treeherder, defect)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wlach, Assigned: wlach)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
eslint (http://eslint.org/) provides a way to automatically validate that javascript follows certain best practices in terms of functionality and coding style. It's very similar in spirit to pyflakes.
To save some time reviewing frontend patches for various nits, I think we should run eslint in travis. This should hopefully simplify the review process somewhat (i.e.: we can ask people to make sure it passes the eslint tests before even starting review) -- :emorley already did this with pyflakes and it seems to have worked great.
It turns out that (unsurprisingly) our front end code currently violates the most basic rules (i.e. "no trailing whitespace", "camel case", "missing semicolon"). However, I think we can fix that incrementally and make our lives easier in the future. :)
Let's start with a patch that verifies a trivial rule ("no trailing whitespace"), then we can file followups to improve things from there.
Assignee | ||
Comment 1•9 years ago
|
||
This is a very basic test for trailing whitespace. Note that we currently fail it -- I'll file another bug to address that problem.
https://travis-ci.org/mozilla/treeherder/builds/70820499
Attachment #8633151 -
Flags: review?(emorley)
Comment 2•9 years ago
|
||
Comment on attachment 8633151 [details] [review]
PR
r=me with path addition
Thank you for doing this :-)
Attachment #8633151 -
Flags: review?(emorley) → review+
Comment 3•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/658927bdf7dce14f4a1e03580193f1aabbfe8c4a
Bug 1183367 - Add a grunt target to run eslint on JS frontend
Assignee | ||
Comment 4•9 years ago
|
||
Ok this is landed.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Component: Treeherder → Treeherder: Docs & Development
Updated•3 years ago
|
Component: Treeherder: Docs & Development → TreeHerder
You need to log in
before you can comment on or make changes to this bug.
Description
•