Remove duplicate ESLint rule definitions from various .eslintrc.js files

RESOLVED FIXED in Firefox 55

Status

enhancement
RESOLVED FIXED
2 years ago
7 months ago

People

(Reporter: standard8, Assigned: tiago, Mentored)

Tracking

3 Branch
mozilla55

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [lang=js])

Attachments

(1 attachment)

In our .eslintrc.js files, we now have some duplicated rules when compared with the default configuration in tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js.

We should remove the duplicated rules to make it clearer as to where the different rules that directories use are.

The current duplicated rules with the associated files are:

Rule: no-eval, Files:
accessible/tests/browser/.eslintrc.js
browser/components/migration/.eslintrc.js
browser/extensions/formautofill/.eslintrc.js
security/.eslintrc.js
toolkit/components/extensions/.eslintrc.js
toolkit/components/narrate/.eslintrc.js

Rule: no-extra-semi, Files:
accessible/tests/browser/.eslintrc.js

Rule: no-sparse-arrays, Files:
accessible/tests/browser/.eslintrc.js

Rule: no-labels, Files:
accessible/tests/browser/.eslintrc.js

Rule: no-undef, Files:
browser/components/resistfingerprinting/test/browser/.eslintrc.js
toolkit/mozapps/extensions/.eslintrc.js

Rule: no-implied-eval, Files:
browser/extensions/formautofill/.eslintrc.js
toolkit/components/extensions/.eslintrc.js

To fix this bug, you'll need to create a patch that removes the appropriate rule(s) from the files as per the above list.

More details about ESLint may be found here: https://developer.mozilla.org/docs/ESLint
Comment on attachment 8870633 [details]
Bug 1367198 - Remove duplicate ESLint rule definitions from various .eslintrc.js files.

https://reviewboard.mozilla.org/r/142090/#review145930

Thank you for the patch, but please drop the devtools/ changes as I mention below. Once that is done, I think this will be ready to push.

::: devtools/.eslintrc.js
(Diff revision 1)
>      // Enforce one true comma style.
>      "comma-style": ["error", "last"],
>      // Warn about cyclomatic complexity in functions.
>      "complexity": ["error", 35],
> -    // Require return statements to either always or never specify values.
> -    "consistent-return": "error",

Please drop the changes to the devtools/.eslintrc.js file - we're not changing those at the moment as they are currently changing their development practices, so we'll sort them out later if needbe.
Attachment #8870633 - Flags: review?(standard8)
Assignee: nobody → tiago.paez11
Comment on attachment 8870633 [details]
Bug 1367198 - Remove duplicate ESLint rule definitions from various .eslintrc.js files.

https://reviewboard.mozilla.org/r/142090/#review146068

::: devtools/.eslintrc.js
(Diff revision 1)
>      // Enforce one true comma style.
>      "comma-style": ["error", "last"],
>      // Warn about cyclomatic complexity in functions.
>      "complexity": ["error", 35],
> -    // Require return statements to either always or never specify values.
> -    "consistent-return": "error",

My bad. I'll remove the changes to this file. I was wondering why this file wasn't on your list, now I know :)
Comment on attachment 8870633 [details]
Bug 1367198 - Remove duplicate ESLint rule definitions from various .eslintrc.js files.

https://reviewboard.mozilla.org/r/142090/#review146318

Great, thank you for the update. r=Standard8.
Attachment #8870633 - Flags: review?(standard8) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/756869c3c638
Remove duplicate ESLint rule definitions from various .eslintrc.js files. r=standard8
https://hg.mozilla.org/mozilla-central/rev/756869c3c638
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Testing → Firefox Build System
Keywords: good-first-bug
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.