<div dir="ltr"><div><div>Hey firefox-dev,<br><br></div>Thanks to a few recent bug fixes [1][2], we now have the ability to fix eslint errors with ease.<br><br></div><div>Anybody
who writes patches that go through treeherder gets an ESLint pass on
their code as part of the build process, but sometimes patches get
backed out or need follow-ups to fix ESLint errors.<br><br></div><div>This is not new, but what is notable is the increased number of recent ESLint rules enabled:<br></div><div>Already landed:<br></div><div><div>* no-else-return (1291855)<br></div><div>* no-empty (1292008)<br></div><div>* space-before-blocks (1292035)<br></div><div>* keyword-spacing (1292042)<br></div><div>* no-ex-assign (1294619)<br></div><div>* no-lonely-if (1294621)<br></div><div>Planned with patches:<br></div><div>* computed-property-spacing (1294618)<br></div><div>* arrow-spacing (1294545)<br></div><div>* comma-spacing (1294547)<br></div><div>* block-spacing (1294542)<br></div></div><div><br></div><div>To
help with development, and as a friendly reminder, there are multiple
ways that you can run ESLint on your code while still in development and
before requesting review.<br><br></div><div>1. Enable the eslint commit hook<br></div><div>1a. In your mercurial.ini file under the [extensions] section, add a line for `mozeslint = c:\fx\tools\mercurial\<wbr>eslintvalidate.py`, where the right-hand-side is the path to your eslintvalidate.py script.<br><br></div><div>2. Enable the respective eslint plugin for your editor<br></div><div>2a. SublimeText3: The DevTools team has a good write-up [3]<br></div><div>2b. Other editors: eslint has a page with more details [4]<br><br></div><div>3. Run `mach eslint`<br></div><div>3a. This will run ESLint on the full tree, and on my machine takes about 2m30s to complete<br></div><div>3b. `mach eslint /path/to/subdirectory` will run ESLint on a subdirectory and complete much faster.<br></div><div><br></div><div>Thanks,<br></div><div>Jared<br></div><br>[1] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1240116" target="_blank">https://bugzilla.mozilla.org/<wbr>show_bug.cgi?id=1240116</a><br>[2] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1291910" target="_blank">https://bugzilla.mozilla.org/<wbr>show_bug.cgi?id=1291910</a><br>[3] <a href="https://wiki.mozilla.org/DevTools/CodingStandards#Running_ESLint_in_SublimeText" target="_blank">https://wiki.mozilla.org/<wbr>DevTools/CodingStandards#<wbr>Running_ESLint_in_SublimeText</a><br>[4] <a href="http://eslint.org/docs/user-guide/integrations" target="_blank">http://eslint.org/docs/user-<wbr>guide/integrations</a></div>