Closed Bug 1359011 Opened 3 years ago Closed 3 years ago

[meta] Make the mozilla/recommended eslint configuration the default for the whole tree

Categories

(Firefox Build System :: Lint and Formatting, enhancement)

3 Branch
enhancement
Not set

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Keywords: meta)

Attachments

(1 file)

Currently we have a lot of rules and different configurations for ESLint spread over the entire tree.

Some of the rules are the same, some are different. This makes it harder for developers to know what is enabled where, and is likely to lead to more inconsistency.

Therefore, I'd like to aim towards enabling mozilla/recommended by default for the whole tree, reducing duplicates where the defined rules are the same, being more explicit about what is disabled where, and what extra rules are enabled.

Overall I want to reduce the .eslintrc.js overheads, and when new components are added they automatically will pick up the recommended config.

Eventually, I'd like to consider getting the rules harmonised across components/directories, ideally ending up with 'one' config (that may not be possible, but it is something to shoot for). Unfortunately our current set-up makes it hard to know where to start, hence the need to cleanup.

Some of this work has already started with the sub-bugs of bug 1354521 and various other bugs.

Over the next couple of weeks I'll have a dig around and see what we need to do to get this enabled at the top level.
I think it would be best to leave devtools untouched during this effort.
devtools is moving out of tree soon, so any rule removals there would just have to be re-done
by someone else.
(In reply to Tom Tromey :tromey from comment #1)
> I think it would be best to leave devtools untouched during this effort.
> devtools is moving out of tree soon, so any rule removals there would just
> have to be re-done by someone else.

That sounds reasonable. I think worst case, we'd just need to add a couple of extra rules to devtools' list where recommended specifies them and devtools doesn't. Note: devtools could use eslint-plugin-mozilla outside the tree - it works for other repositories now (via npm).
Depends on: 1359540
Depends on: 1359604
Depends on: 1359614
Depends on: 1360166
Depends on: 1360293
Depends on: 1361760
Depends on: 1363353
Depends on: 1363790
Depends on: 1363793
Depends on: 1363795
Note: the patch will need bug 1363795 if you're applying it locally. Bug 1363795 is currently on autoland.
Comment on attachment 8869344 [details]
Bug 1359011 - Make the mozilla/recommended eslint configuration the default for the whole tree.

https://reviewboard.mozilla.org/r/140976/#review144618
Attachment #8869344 - Flags: review?(dtownsend) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/32ba9f887603
Make the mozilla/recommended eslint configuration the default for the whole tree. r=mossop
https://hg.mozilla.org/mozilla-central/rev/32ba9f887603
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.