Closed Bug 1917530 Opened 1 month ago Closed 1 month ago

Change ESLint rule no-shadow to be enabled by default and disabled where it currently fails

Categories

(Developer Infrastructure :: Lint and Formatting, task, P3)

Tracking

(firefox132 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(6 files)

For switching eslint-plugin-mozilla to the ESLint flat configuration, one item we need to do is to separate out the overrides sections of recommended.js to separate configurations, due to how the flat config works with respect to plugins (bug 1917529).

Having looked at this, it would be simpler to split the configurations if we change how the no-shadow rule is handled for builtinGlobals. Currently the builtinGlobals part is enabled for modules, but disabled for system modules & workers.

As a follow-up to this, I decided now would be a reasonable time to switch no-shadow to being disabled everywhere by default to being enabled everywhere & disabled where it currently fails. This should hopefully help to start having new code pick it up automatically.

This moves the ESLint rule to apply to jsx, system modules and workers. It is excluded from most system
modules by the roll out, which we can work on later. However, it will be enabled where no-shadow is
already enabled - previously these were hidden due to the order in which ESLint was applying the rules.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed6b35444c45 Fix ESLint no-shadow issues in aboutwelcome code. r=omc-reviewers,emcminn https://hg.mozilla.org/integration/autoland/rev/1a45047dfb3c Fix ESLint no-shadow issues in newtab code. r=home-newtab-reviewers,nbarrett https://hg.mozilla.org/integration/autoland/rev/c4011d92c7f7 Fix ESLint no-shadow issues in devtools code. r=devtools-reviewers,profiler-reviewers,frontend-codestyle-reviewers,nchevobbe,julienw,mossop https://hg.mozilla.org/integration/autoland/rev/8a361e37e32c Fix some ESLint no-shadow issues in misc code. r=frontend-codestyle-reviewers,perftest-reviewers,translations-reviewers,omc-reviewers,migration-reviewers,webcompat-reviewers,urlbar-reviewers,dao,twisniewski,sparky,mconley,emcminn,mossop https://hg.mozilla.org/integration/autoland/rev/1d2325ffded6 Enable ESLint rule no-shadow on system modules where no-shadow is enabled already, and warn for remaining failures. r=frontend-codestyle-reviewers,mossop https://hg.mozilla.org/integration/autoland/rev/d5e110187781 Enable ESLint rule no-shadow by default across the tree, disabling where it currently fails. r=frontend-codestyle-reviewers,mossop
Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5344eb368840 Fix ESLint no-shadow issues in aboutwelcome code. r=omc-reviewers,emcminn https://hg.mozilla.org/integration/autoland/rev/cdab6319ec9f Fix ESLint no-shadow issues in newtab code. r=home-newtab-reviewers,nbarrett https://hg.mozilla.org/integration/autoland/rev/60aa562befe5 Fix ESLint no-shadow issues in devtools code. r=devtools-reviewers,profiler-reviewers,frontend-codestyle-reviewers,nchevobbe,julienw,mossop https://hg.mozilla.org/integration/autoland/rev/66db0a99fe46 Fix some ESLint no-shadow issues in misc code. r=frontend-codestyle-reviewers,perftest-reviewers,translations-reviewers,omc-reviewers,migration-reviewers,webcompat-reviewers,urlbar-reviewers,dao,twisniewski,sparky,mconley,emcminn,mossop https://hg.mozilla.org/integration/autoland/rev/ebda61c817e4 Enable ESLint rule no-shadow on system modules where no-shadow is enabled already, and warn for remaining failures. r=frontend-codestyle-reviewers,mossop https://hg.mozilla.org/integration/autoland/rev/ae57dc81f58d Enable ESLint rule no-shadow by default across the tree, disabling where it currently fails. r=frontend-codestyle-reviewers,mossop
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: