Bug 1881701 - Move ESLint ignores and test paths to be module files as well. r=frontend-codestyle-reviewers,devtools-reviewers,Gijs,nchevobbe
This completes the moving of all the top-level configuration files to be ES modules, and named similarily. Differential Revision: https://phabricator.services.mozilla.com/D250403
This commit is contained in:
committed by
mbanner@mozilla.com
parent
05fa2d5325
commit
8bf730ccd9
@@ -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)
|
||||
##############################################################################
|
||||
|
||||
|
||||
@@ -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)))
|
||||
|
||||
@@ -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 <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 <tools/rewriting/ThirdPartyPaths.txt>`.
|
||||
* If it is a generated file, please add it to :searchfox:`Generated.txt <tools/rewriting/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 <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 <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 <adding-tests>`
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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],
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user