<div dir="ltr"><div>That is super cool! <br></div><div><br></div><div>Can we make sure this is documented in (or linked from) <a href="https://developer.mozilla.org/en-US/docs/ESLint">the lint page</a> and <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch">the developer guide</a>? New contributors will really appreciate this.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 7:01 AM, Andrew Halberstadt <span dir="ltr"><<a href="mailto:ahalberstadt@mozilla.com" target="_blank">ahalberstadt@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>tl;dr - |mach lint -wo| will lint what you want in 95% of cases<br></div><div><br></div><div>I'm excited about two new features added to |mach lint| (make sure to update to latest central):</div><div><br></div><div>1) Lint outgoing changes with:</div><div><br></div><div> ./mach lint --outgoing</div><div><br></div><div>This will lint all files touched by revisions *which would be pushed upstream*. With hg, make sure you have a default push defined. On git, the default remote repository should be automagically detected. In either case, you can also manually specify the remote target:</div><div><br></div><div> ./mach lint --outgoing <a href="https://hg.mozilla.org/releases/mozilla-beta" target="_blank">https://hg.mozilla.org/<wbr>releases/mozilla-beta</a></div><div><br></div><div>2) Lint working directory changes with:</div><div><br></div><div> ./mach lint --workdir</div><div><br></div><div>This lints all files touched in the working directory. On git, this includes both staged and unstaged changes.</div><div><br></div><div>You can run both of these at once with:</div><div><br></div><div> ./mach lint -wo</div><div><br></div><div>For almost all use cases, the above command is all you need to remember. Mozlint (the library behind mach lint) will automatically determine what linters (eslint, flake8, wpt, etc) need to run against which files and do the right thing. So if you typically run |mach eslint|, I'd encourage you to start switching over to |mach lint| instead*.</div><div><br></div><div>While these options call into the underlying vcs (and can therefore be a bit slower than specifying a path), they drastically reduce the number of files linted, so overall are much faster than linting an entire directory. The main caveat is that if you modify the lint configuration itself, mozlint is not smart enough to know that the entire tree should be linted. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1373368" target="_blank">Bug 1373368</a> is filed for this.<br></div><div><br></div><div>Please let me know if you find any bugs or bad UX while using these!</div><div>Cheers,</div><div>Andrew<br></div><div><br></div><div>* mach eslint is already an alias to mach lint --linter eslint<br></div></div>
<br>______________________________<wbr>_________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/<wbr>listinfo/firefox-dev</a><br>
<br></blockquote></div><br></div>