Closed Bug 1881701 (eslint-flat) Opened 1 year ago Closed 29 days ago

Migrate ESLint configuration to flat config

Categories

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

Tracking

(firefox140 fixed)

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

(Depends on 1 open bug, Blocks 5 open bugs)

Details

Attachments

(15 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

In upgrading to ESLint v9, we think we can first migrate to the flat configuration in v8, before upgrading to v9 itself.

To do this we'll need to fix the issues this depends on and then investigate:

  • Importing the ESLint ignore file.
    • Secondary thought: could it be merged/shared with the prettier file?
  • Are there any more simple sub-level .eslintrc.js files that could be cleaned up and merged into the top-level config, or their parents?
  • Convert the top-level .eslintrc.js file to eslint.config.mjs
    • For the sub-level .eslintrc.js files, load those (via an explicit list), into the top-level configuration and add them to the list of configurations.
Blocks: 1881702
Alias: eslint-flat
Depends on: 1907841
Depends on: 1907846
Depends on: 1951365

I now have patches for this. They are a bit complex, but seem to work, and there's probably going to be lots of follow-ups to do later. However, aiming to get these landed before the 140 freeze, so that ESR will at least have all the changed settings files, in case changes need to be uplifted.

Assignee: nobody → standard8
Status: NEW → ASSIGNED

This is separate to help preserve history of the files.

This also sets up recommended.js to match against the required file extensions, which is needed for the configuration to work correctly.

This consolidates the jest environment definition, and the xpcshell globals into the devtools/.eslintrc.mjs file, for easier configurations.
It also changes the restart of the configurations to work with flat config.

This helps fix raised issues in customizable UI code which turns rules off in its own directory.

Blocks: 1967201
Blocks: 1967204
Blocks: 1967219
Depends on: 1967249
Blocks: 1967461

This completes the moving of all the top-level configuration files to be ES modules, and named similarily.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eb2701d51897 Configure testing/mochitest/tests/Harness_sanity/ test setup with eslintrc-test-paths rather than its own .eslintrc.js set-up. r=frontend-codestyle-reviewers,Gijs https://hg.mozilla.org/integration/autoland/rev/d3114c8f716e Rename many ESLint files to use .mjs. r=frontend-codestyle-reviewers,perftest-reviewers,Gijs,sparky,webcompat-reviewers,twisniewski https://hg.mozilla.org/integration/autoland/rev/e3c80f00b02b Add some utility functions to eslint-plugin-mozilla to support flat config processing. r=frontend-codestyle-reviewers,Gijs https://hg.mozilla.org/integration/autoland/rev/000233049ab0 Change the devtools configurations to work with the ESLint flat configuration.r=devtools-reviewers,profiler-reviewers,julienw,nchevobbe https://hg.mozilla.org/integration/autoland/rev/30bb0943828a Change new .eslintrc.mjs files to modules (browser/), and export as flat config. r=frontend-codestyle-reviewers,extension-reviewers,pip-reviewers,credential-management-reviewers,search-reviewers,places-reviewers,omc-reviewers,migration-reviewers,home-newtab-reviewers,urlbar-reviewers,aminomancer,daisuke,dimi,robwu,jteow,mconley https://hg.mozilla.org/integration/autoland/rev/22e7ea4dde93 Change new .eslintrc.mjs files to modules (toolkit/), and export as flat config. r=frontend-codestyle-reviewers,extension-reviewers,credential-management-reviewers,Gijs,mossop,dimi,robwu https://hg.mozilla.org/integration/autoland/rev/2d52ba4350fd Change new .eslintrc.mjs files to modules (misc), and export as flat config. r=frontend-codestyle-reviewers,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,devtools-reviewers,sync-reviewers,android-reviewers,mossop,spidermonkey-reviewers,Gijs,ohall,whimboo,nchevobbe,arai,sparky,skhamis,webcompat-reviewers,twisniewski https://hg.mozilla.org/integration/autoland/rev/1f962d559236 Switch the main ESLint configuration to use the flat configuration. r=frontend-codestyle-reviewers,Gijs https://hg.mozilla.org/integration/autoland/rev/62ad4b186ae9 Change how ESLint valid/require-jsdoc configurations are applied, so that the config is applied before sub-configs. r=frontend-codestyle-reviewers,mossop https://hg.mozilla.org/integration/autoland/rev/363a2a5d0a21 Fix ESLint issues shown up by improved configuration application. r=frontend-codestyle-reviewers,application-update-reviewers,credential-management-reviewers,bytesized,dimi https://hg.mozilla.org/integration/autoland/rev/968062cd7933 Add toolkit/modules/third_party to ThirdPartyPaths.txt. r=frontend-codestyle-reviewers,mossop https://hg.mozilla.org/integration/autoland/rev/07433b508a89 Automatically fix new issues raised in devtools. r=devtools-reviewers,frontend-codestyle-reviewers,mossop,nchevobbe https://hg.mozilla.org/integration/autoland/rev/c78852cfbe1b Fix remainder of newly raised devtools issues after switching to the ESLint flat config. r=devtools-reviewers,frontend-codestyle-reviewers,mossop,nchevobbe https://hg.mozilla.org/integration/autoland/rev/8a96bebed69f Fix python tests related to the ESLint linter. r=linter-reviewers,frontend-codestyle-reviewers,sylvestre https://hg.mozilla.org/integration/autoland/rev/a58949ca6435 Move ESLint ignores and test paths to be module files as well. r=frontend-codestyle-reviewers,devtools-reviewers,Gijs,nchevobbe
Regressions: 1968536
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: