Bug 1755907 - [devtools] Enable eslint on debugger tests (except their test pages). r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D139366
This commit is contained in:
Alexandre Poirot 2022-02-23 18:38:26 +00:00
parent 681e4456ef
commit 4f6825b177
11 changed files with 35 additions and 17 deletions

View file

@ -58,11 +58,14 @@ browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.jsm
# Ignore devtools debugger files which aren't intended for linting, and also
# aren't included in any .eslintignore or .prettierignore file.
# See https://github.com/firefox-devtools/debugger/blob/master/package.json#L24
devtools/client/debugger/bin/
devtools/client/debugger/configs/
devtools/client/debugger/dist/
devtools/client/debugger/images/
devtools/client/debugger/test/
devtools/client/debugger/packages/
devtools/client/debugger/test/mochitest/examples/
devtools/client/debugger/index.html
devtools/client/debugger/webpack.config.js
# Ignore devtools preferences files
devtools/client/preferences/

View file

@ -50,12 +50,12 @@ const ignorePatterns = [
.split("\n"),
...fs
.readFileSync(
path.join(__dirname, "devtools", "client", "debugger", ".eslintignore")
path.join(__dirname, "devtools", "client", "debugger", "src", ".eslintignore")
)
.toString("utf-8")
.split("\n")
.filter(p => p && !p.startsWith("#"))
.map(p => `devtools/client/debugger/${p}`),
.map(p => `devtools/client/debugger/src/${p}`),
];
module.exports = {

View file

@ -37,6 +37,7 @@ module.exports = {
"client/shared/*.jsm",
"client/shared/widgets/*.jsm",
"client/storage/VariablesView.jsm",
"client/debugger/test/**",
],
rules: {
"consistent-return": "off",
@ -77,7 +78,7 @@ module.exports = {
},
},
{
files: ["client/framework/**"],
files: ["client/framework/**", "client/debugger/test/**"],
rules: {
strict: "off",
},
@ -135,7 +136,7 @@ module.exports = {
excludedFiles: [
// Debugger modules have a custom bundling logic which relies on relative
// paths.
"client/debugger/**",
"client/debugger/src/**",
// `client/shared/build` contains node helpers to build the debugger and
// not devtools modules.
"client/shared/build/**",

View file

@ -1,10 +0,0 @@
assets/*
src/test/examples/**
src/test/integration/**
src/test/unit-sources/**
src/**/fixtures/**
src/test/mochitest/**
bin/
packages/**/fixtures/**
node_modules
out

View file

@ -2,6 +2,10 @@
* 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";
/* global __dirname */
/**
* NOTE: This file does not apply to builds in MC. This config is used for
* our Jest tests and for webpack bundle builds.

View file

@ -2,6 +2,10 @@
* 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";
/* global __dirname */
const sharedJestConfig = require(`${__dirname}/../shared/test-helpers/shared-jest.config`);
const { resolve } = require("path");

View file

@ -2,6 +2,10 @@
* 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";
/* global __dirname */
const { resolve } = require("path");
const rootDir = resolve(__dirname);
module.exports = {

View file

@ -2,6 +2,8 @@
* 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";
const { MultiLocalizationHelper } = require("devtools/shared/l10n");
const {
FluentL10n,
@ -158,7 +160,7 @@ class DebuggerPanel {
unHighlightDomElement() {
if (!this._unhighlight) {
return;
return Promise.resolve();
}
return this._unhighlight();

View file

@ -0,0 +1,5 @@
test/examples/**
test/integration/**
test/unit-sources/**
**/fixtures/**
test/mochitest/**

View file

@ -8,7 +8,12 @@
*/
/* eslint-disable no-unused-vars */
/* import-globals-from ./head.js */
// We can't use "import globals from head.js" because of bug 1395426.
// So workaround by manually importing the few symbols we are using from it.
// (Note that only ./mach eslint devtools/client fails while devtools/client/debugger passes)
/* global EXAMPLE_URL, ContentTask */
// Assume that shared-head is always imported before this file
/* import-globals-from ../../../shared/test/shared-head.js */