Closed Bug 1611422 Opened 4 years ago Closed 4 years ago

Mark the root of the source tree as the root directory in .eslintrc.js

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement
Not set
normal

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: robwu, Assigned: robwu)

Details

Attachments

(1 file)

I use git worktree to simultaneously work on multiple checkouts of Gecko, with the following directory structure:

  • gecko/
  • gecko/worktree1/
  • gecko/worktree2/
  • etc.

Recently I discovered that my patch failed linting, despite not generating any linting errors locally. For example, with the following:

$  ./mach eslint browser/components/distribution.js
✖ 0 problems (0 errors, 1 warning)

Notice the hidden warning. I got the full warning output as follows:

$  ./node_modules/.bin/eslint browser/components/distribution.js

/path/to/gecko/worktree1/browser/components/distribution.js
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

✖ 1 problem (0 errors, 1 warning)

The file is not part of any .eslintignore as far as I am aware, yet it was still excluded.
When I run eslint with --debug, I see that it also looked up the eslint config in the parent directory (which itself was also a gecko checkout), which caused the file to be ignored.

To fix this, I propose to mark the root of the source tree as the root of eslint, so that the linter is not affected by configurations in parent directories.

Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/483d95480969
Mark source tree root as root in eslint config r=Standard8
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: