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)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wlach, Assigned: wlach)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
emorley
: review+
Details | Review
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.
Attached file PR
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)
Depends on: 1183385
Comment on attachment 8633151 [details] [review] PR r=me with path addition Thank you for doing this :-)
Attachment #8633151 - Flags: review?(emorley) → review+
Ok this is landed.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Component: Treeherder → Treeherder: Docs & Development
Blocks: 1183749
Component: Treeherder: Docs & Development → TreeHerder
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: