<div dir="ltr"><div><div><div><div>I just discovered the concept of pre-processors in eslint, I had no idea this even existed. Find out more info here:<br><a href="http://eslint.org/docs/developer-guide/working-with-plugins#processors-in-plugins">http://eslint.org/docs/developer-guide/working-with-plugins#processors-in-plugins</a><br><br></div>tl;dr;<br></div>We can use this to process our source files before eslint rules are run on them.<br>So, in particular, we can do things like:<br>- filter out ifdef instructions,<br></div>- define global variables from imported modules (from e.g. Cu.import)<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 2, 2015 at 2:28 AM, Dave Townsend <span dir="ltr"><<a href="mailto:dtownsend@mozilla.com" target="_blank">dtownsend@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 class="HOEnZb"><div class="h5">On Tue, Dec 1, 2015 at 5:26 PM, Lawrence Mandel <<a href="mailto:lmandel@mozilla.com">lmandel@mozilla.com</a>> wrote:<br>
> On Tue, Dec 1, 2015 at 1:00 PM, Michael Comella<br>
> <<a href="mailto:michael.l.comella@gmail.com">michael.l.comella@gmail.com</a>> wrote:<br>
>><br>
>> On Sat, Nov 28, 2015 at 7:56 AM, Mark Finkle <<a href="mailto:mfinkle@mozilla.com">mfinkle@mozilla.com</a>> wrote:<br>
>>><br>
>>> When I run | mach eslint | I get this error:<br>
>>><br>
>>> Error: Cannot find module 'eslint-plugin-mozilla'<br>
>>><br>
>>> How do I get that plugin?<br>
>><br>
>> I filed a bug to either alert the user to warn this if they haven't done<br>
>> so already, or to just run it automatically:<br>
>>   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1211483" rel="noreferrer" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=1211483</a><br>
>><br>
>> Given the sudo issues another person posted, we should warn about that<br>
>> too. It'd be great to get some traction on this – it's a confusing<br>
>> experience!<br>
>>><br>
>>><br>
>>> On Fri, Nov 27, 2015 at 5:53 PM, Dave Townsend <<a href="mailto:dtownsend@mozilla.com">dtownsend@mozilla.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> We don't really have automation testing this right now but hopefully<br>
>>>> we will soon. For now you can add support to editors like Sublime to<br>
>>>> tell you when you're making mistakes:<br>
>>>><br>
>>>> <a href="https://blog.mozilla.org/standard8/2015/05/13/using-eslint-alongside-the-firefox-hello-code-base-to-help-productivity/" rel="noreferrer" target="_blank">https://blog.mozilla.org/standard8/2015/05/13/using-eslint-alongside-the-firefox-hello-code-base-to-help-productivity/</a><br>
>><br>
>><br>
>> We've had eslint working in mobile for a while but frankly, I don't think<br>
>> anyone has used it (e.g. we have failures now). I don't think this will<br>
>> become truly useful without some automated testing – is there a bug open for<br>
>> this?<br>
><br>
><br>
> I don't know if there's a bug but this type of work is on the list for<br>
> MozReview and it should be integrated other places as well. The key is to<br>
> catch regressions like these before they are committed to the tree.<br>
<br>
</div></div>We definitely want to catch this before it hits the tree but I've also<br>
filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1229588" rel="noreferrer" target="_blank">https://bugzilla.mozilla.org/show_bug.cgi?id=1229588</a> so we have<br>
an in-tree check as well (which would of course work on try). I'm also<br>
going to experiment with a hg pre-commit hook that you can install<br>
locally.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<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/listinfo/firefox-dev</a><br>
</div></div></blockquote></div><br></div>