Closed
Bug 1369829
Opened 8 years ago
Closed 8 years ago
eslint-plugin-mozilla requires .eslintignore, which I didn't expect
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Tracking
(firefox56 fixed)
RESOLVED
FIXED
mozilla56
| Tracking | Status | |
|---|---|---|
| firefox56 | --- | fixed |
People
(Reporter: glind, Assigned: standard8)
Details
Attachments
(1 file)
`helpers.js:rootDir()` uses the existence of `.eslintignore` to determine the root of a directory. This seems a little unexpected, for people who are using this package outside m-c.
Suggested remedy:
- Unclear. Documentation if nothing else.
- Clearer error message, saying something about `.eslintignore`.
Use case:
- linting system addon build directories
- restartless addons
- re-usable `.jsm` libraries.
Thanks!
GL
| Reporter | ||
Comment 1•8 years ago
|
||
Version: "eslint-plugin-mozilla": "^0.3.2"
| Assignee | ||
Comment 2•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2be1833d89d2 might have already fixed this.
Can you install eslint-plugin-mozilla from a local copy of mozilla-central, and see if that fixes it?
We've already got various system add-ons & other repositories using eslint-plugin-mozila, though I think they all have .eslintignore at the top level, xref:
https://github.com/mozilla/one-off-system-add-ons/
https://github.com/mozilla/example-addon-repo/
| Reporter | ||
Comment 3•8 years ago
|
||
That patch fixes a different problem, but still assumes there is an `.eslintignore` somewhere up ONE OF SEVERAL trees.
I claim the easiest fix is to have the `throw` at https://hg.mozilla.org/mozilla-central/rev/2be1833d89d2#l1.42 be more descriptive, and mention you need to have an `.eslintignore` somewhere.
(Side note: i have no idea of why it is needed, but I bet it is for Good Reasons!)
GL
| Assignee | ||
Comment 4•8 years ago
|
||
Ok, so I hit this over the weekend. For me, ESLint seems to just say that it can't find the mozilla package. I think we can do two things:
1) Look for package.json as a fallback if we can't find .eslintignore
2) Use the current working directory.
I think that should cover most instances that we'll come across.
Assignee: nobody → standard8
| Comment hidden (mozreview-request) |
Comment 6•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8878048 [details]
Bug 1369829 - Make eslint-plugin-mozilla more flexible with finding the root directory of the repository.
https://reviewboard.mozilla.org/r/149468/#review154156
Attachment #8878048 -
Flags: review?(dtownsend) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2a03a91b03e8
Make eslint-plugin-mozilla more flexible with finding the root directory of the repository. r=mossop
Comment 8•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
| Reporter | ||
Comment 9•8 years ago
|
||
This feels like a very robust solution! The code looks very nice!
Any chance we can get a new release to npm? (Assuming it's on the way, and I am impatient)
Flags: needinfo?(standard8)
| Assignee | ||
Comment 10•8 years ago
|
||
Gregg: sorry, I totally forgot to push the new version - thanks for reminding me, 0.3.4 is out now.
Flags: needinfo?(standard8)
Updated•8 years ago
|
Product: Testing → Firefox Build System
Updated•7 years ago
|
Version: Version 3 → 3 Branch
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•