On Thu, Jul 2, 2015 at 6:56 PM, Nicholas Alexander <[email protected]>
wrote:

> Using other paths may not read the configuration files correctly and the
>> output may be unexpected.
>>
>
> I don't know much about eslint's operation -- does it not search up the
> tree for a .eslintrc?  Would it be helpful to only accept paths that have
> .eslintrc in them?
>

Yes – I think we should whitelist the paths that `mach eslint` allows – I
filed [1].

The issue is that it is recommended to run with the .eslintignore file at
the root of the project because it is only searched for in the working
directory. Even if a file is used outside the project root (via
`--ignore-path`), the paths specified in the ignore file are relative *not*
to the ignore file (as would be intuitive and as other programs, such as
git, do) but to the working directory. Therefore running `mach eslint
mobile/android/base` would not use the proper ignore file
(mobile/android/.eslintignore) and the output would be unexpected.

To be thorough, .eslintrc files don't pose an issue because they are
searched for from the working directory to the root of the filesystem (I'm
unclear if the path to lint and it's parent directories are included in
this search, but since we change the working directory when running eslint
because of the ignore file, it's a non-issue).

- Mike (:mcomella)

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1180345
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to