diff --git a/.prettierignore b/.prettierignore index 5d7f26eb2b8b..996ddfab5a50 100644 --- a/.prettierignore +++ b/.prettierignore @@ -987,8 +987,8 @@ tools/jprof/README.html uriloader/exthandler/tests/mochitest/save_filenames.html ############################################################################## -# The list below is copied from .eslintrc-ignores.js. Prettier doesn't currently -# support multiple ignore files or dynamic ignore configurations. +# The list below is copied from eslint-ignores.config.mjs. Prettier doesn't +# currently support multiple ignore files or dynamic ignore configurations. # When this is implemented, we'll update the configuration below (bug 1825508) ############################################################################## diff --git a/devtools/docs/contributor/contributing/eslint.md b/devtools/docs/contributor/contributing/eslint.md index debb5aa16c1d..016d35abbe09 100644 --- a/devtools/docs/contributor/contributing/eslint.md +++ b/devtools/docs/contributor/contributing/eslint.md @@ -80,7 +80,7 @@ You should see errors and warnings in the gutter as shown in the screenshot belo (when (string-match "^\\([a-z]+_\\)" base) (setq-local flycheck-temp-prefix (match-string 1 base)))) (let ((base-dir (locate-dominating-file (buffer-file-name) - ".eslintrc-ignores.js"))) + "eslint-ignores.config.mjs"))) (when base-dir (let ((eslint (expand-file-name "tools/lint/eslint/node_modules/.bin/eslint" base-dir))) diff --git a/docs/code-quality/lint/linters/eslint.rst b/docs/code-quality/lint/linters/eslint.rst index 4ac84665731a..a60be183f608 100644 --- a/docs/code-quality/lint/linters/eslint.rst +++ b/docs/code-quality/lint/linters/eslint.rst @@ -102,7 +102,7 @@ cycle. * If you really can't match the directory name, e.g. like the ``browser/base/content/tests/*``, then you'll need to add a new entry in - :searchfox:`.eslintrc-test-paths.js <.eslintrc-test-paths.js>`. + :searchfox:`eslint-test-paths.config.mjs `. Please do not add new cases of multiple types of tests within a single directory, this is `difficult for ESLint to handle`_. Currently this may cause: @@ -116,7 +116,7 @@ This code should neither be linted nor formatted * If it is a third-party piece of code, please add it to :searchfox:`ThirdPartyPaths.txt `. * If it is a generated file, please add it to :searchfox:`Generated.txt `. -* If intentionally invalid, please add it to :searchfox:`.eslintrc-ignores.js <.eslintrc-ignores.js>`. +* If intentionally invalid, please add it to :searchfox:`eslint-ignores.config.mjs `. This code shouldn't be formatted ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -134,7 +134,7 @@ See the `prettier ignore docs`_ for more information. I have valid code that is failing the ``no-undef`` rule or can't be parsed ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -* Please do not add this to :searchfox:`.eslintrc-ignores.js <.eslintrc-ignores.js>`. Generally +* Please do not add this to :searchfox:`eslint-ignores.config.mjs `. Generally this can be fixed, if the following tips don't help, please `seek help`_. * If you are adding a new test directory, see the :ref:`section above ` diff --git a/.eslintrc-ignores.js b/eslint-ignores.config.mjs similarity index 99% rename from .eslintrc-ignores.js rename to eslint-ignores.config.mjs index fea020b2a1e8..20e7b9458c19 100644 --- a/.eslintrc-ignores.js +++ b/eslint-ignores.config.mjs @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - /** * Files to exclude from ESLint. * @@ -20,7 +18,7 @@ * * @type {string[]} */ -module.exports = [ +export default [ // Include all js dot files. "!.*.js", diff --git a/.eslintrc-test-paths.js b/eslint-test-paths.config.mjs similarity index 99% rename from .eslintrc-test-paths.js rename to eslint-test-paths.config.mjs index 5297e79b669f..5b88fb6d302a 100644 --- a/.eslintrc-test-paths.js +++ b/eslint-test-paths.config.mjs @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - // The `*testPaths` defined below for test paths are the main path formats we // prefer to support for tests as they are commonly used across the tree. @@ -469,7 +467,7 @@ incorrectly applied. paths.add(path); } -module.exports = { +export default { testPaths: { browser: [...browserTestPaths, ...extraBrowserTestPaths], chrome: [...chromeTestPaths, ...extraChromeTestPaths], diff --git a/eslint.config.mjs b/eslint.config.mjs index ca2f9cc950be..fc61318a2650 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -16,8 +16,8 @@ import globals from "globals"; import path from "path"; import { fileURLToPath } from "url"; -import globalIgnores from "./.eslintrc-ignores.js"; -import testPathsConfig from "./.eslintrc-test-paths.js"; +import globalIgnores from "./eslint-ignores.config.mjs"; +import testPathsConfig from "./eslint-test-paths.config.mjs"; import repositoryGlobals from "./eslint-file-globals.config.mjs"; import rollouts from "./eslint-rollouts.config.mjs"; import subdirConfigs from "./eslint-subdirs.config.mjs"; diff --git a/mots.yaml b/mots.yaml index 7a3e6e9c270e..ec79cd618d9b 100644 --- a/mots.yaml +++ b/mots.yaml @@ -8,7 +8,7 @@ # documentation and how to modify this file. repo: mozilla-central created_at: '2021-10-14T12:50:40.073465' -updated_at: '2025-05-07T01:05:49.262826+00:00' +updated_at: '2025-05-21T09:20:14.661913+00:00' export: path: ./docs/mots/index.rst format: rst @@ -3997,7 +3997,7 @@ modules: description: Aspects of JavaScript use such as language feature usage, tooling such as lint configurations, formatting and naming style. includes: - - .eslintrc-test-paths.js + - eslint*.config.mjs - '**/.eslintrc*.js' - tools/lint/eslint/**/* - .prettier* @@ -4567,5 +4567,5 @@ modules: - Ryan Tilder group: dev-platform hashes: - config: 3825a00753e2baaf500e62ea796ece96149e6937 - export: e1e1829b45285c4e3a60c73a99e323a033d64945 + config: 417f5aa3364f94e036f02a3612a733ab3cc9884a + export: f91f79309801aa730bc99a9a1f2bc64db1e64718