| modern JS tooling, another step: eslint support of Loop/Hello patches | Dan Mosedale | 05/05/15 15:58 | At the moment, this is mostly of interest to folks using editors that have eslint integration (eg Sublime, Vim, Emacs, TextMate, IntelliJ...) who need to write a patch that touches the Hello code. The win is that your editor will give you fast feedback (i.e. as you type) on certain sorts of mistakes and style violations so that you don't have to go restart just to find out that you've forgotten a brace or (soon!) misspelled a variable name. Because eslint supports much of ES6, we've got eslintrc files configured for the various parts of browser/components/loop configured for the current state of almost all of our chrome and content JavaScript files. https://dxr.mozilla.org/mozilla-central/source/browser/components/loop/.eslintrc is the top-level file, and it has pointers to the others. Which is to say everything should pass as currently configured. To take advantage of this, you'll need to have node installed, and then: You'll want to enable/install the eslint integration for your editor: http://eslint.org/docs/user-guide/integrations https://dxr.mozilla.org/mozilla-central/source/browser/components/loop/README.txt#43 has more details on using things with loop. We're gradually opting-in to more and more rules (including those from the ESlint React plugin) to catch more issues (see https://bugzilla.mozilla.org/show_bug.cgi?id=1150279 to follow the fun). Dan |
| Re: modern JS tooling, another step: eslint support of Loop/Hello patches | Mark Banner | 13/05/15 12:28 | On 05/05/2015 23:57, Dan Mosedale wrote:I just blogged about some of this and my setup - and it also includes a "starter" configuration file that folks can use to test out running eslint against individual files (global running is broken for some reason at the moment which I'm looking into). https://blog.mozilla.org/standard8/2015/05/13/using-eslint-alongside-the-firefox-hello-code-base-to-help-productivity/ Mark |