De-duplicate already ESLint recommended rules in browser/components/migration/.eslintrc.js

RESOLVED FIXED in Firefox 55

Status

RESOLVED FIXED
2 years ago
3 months ago

People

(Reporter: standard8, Assigned: dbugs, Mentored)

Tracking

({good-first-bug})

3 Branch
mozilla55
good-first-bug

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [lang=js])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
We now have a recommend set of rules for ESLint in Mozilla, I'd like for us to tidy up duplicates, so that it is easier to see where modules/different areas are different.

This bug is to tidy up browser/components/migration/.eslintrc.js.

I'm happy to mentor this.

Recommended rules: https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js

What needs doing (all in the file browser/components/migration/.eslintrc.js):

- Remove the extends section, as this is unnecessary (ESLint inherits rules through the directory tree).
- For the rules, globals and env sections, go through each one and compare to the recommended, then:
-- If it is the same (with the same parameters), remove the rule
-- If it is commented, remove it
-- If it is different, leave it in.
- Finally check ESLint still runs correctly (./mach eslint) and passes with no errors (warnings are ok if they are the same as previous).

Once that's done, attach a patch and request review from me (Standard8)
(Reporter)

Updated

2 years ago
Keywords: good-first-bug
Whiteboard: [lang=js]
(Reporter)

Updated

2 years ago
Blocks: 1354521
(Reporter)

Updated

2 years ago
Assignee: nobody → dbugs
Comment hidden (mozreview-request)
(Reporter)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8857892 [details]
Bug 1354512 - De-duplicate already ESLint recommended rules in browser/components/migration/.

https://reviewboard.mozilla.org/r/129928/#review132514

Looking good, but there's a couple more items that can be cleaned up as well.

::: browser/components/migration/.eslintrc.js:5
(Diff revision 1)
> -  "extends": [
> -    "../../.eslintrc.js"
> -  ],
> -
>    "globals": {
>      "Components": true,

Components can also be removed.

::: browser/components/migration/.eslintrc.js:22
(Diff revision 1)
> -    "no-dupe-keys": "error",
> -    "no-duplicate-case": "error",
> -    "no-else-return": "error",
>      "no-eval": "error",
>      "no-extend-native": "error",
> -    // "no-extra-bind": "error",
> +    "no-extra-semi": "error",

"no-extra-semi" can also be removed.
Attachment #8857892 - Flags: review?(standard8)
(Assignee)

Comment 3

2 years ago
mozreview-review-reply
Comment on attachment 8857892 [details]
Bug 1354512 - De-duplicate already ESLint recommended rules in browser/components/migration/.

https://reviewboard.mozilla.org/r/129928/#review132514

finished
Comment hidden (mozreview-request)
(Reporter)

Comment 5

2 years ago
mozreview-review
Comment on attachment 8857892 [details]
Bug 1354512 - De-duplicate already ESLint recommended rules in browser/components/migration/.

https://reviewboard.mozilla.org/r/129928/#review132526

Looks great, thank you!
Attachment #8857892 - Flags: review?(standard8) → review+

Comment 6

2 years ago
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f03074fed187
De-duplicate already ESLint recommended rules in browser/components/migration/. r=standard8

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f03074fed187
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55

Updated

a year ago
Product: Testing → Firefox Build System
Keywords: good-first-bug
Version: Version 3 → 3 Branch
Keywords: good-first-bug
You need to log in before you can comment on or make changes to this bug.