2020-03-18 12:27:54 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
|
|
|
|
2016-10-18 10:38:10 +03:00
|
|
|
"use strict";
|
|
|
|
|
2019-03-28 12:38:02 +03:00
|
|
|
const xpcshellTestConfig = require("eslint-plugin-mozilla/lib/configs/xpcshell-test.js");
|
|
|
|
const browserTestConfig = require("eslint-plugin-mozilla/lib/configs/browser-test.js");
|
|
|
|
const mochitestTestConfig = require("eslint-plugin-mozilla/lib/configs/mochitest-test.js");
|
|
|
|
const chromeTestConfig = require("eslint-plugin-mozilla/lib/configs/chrome-test.js");
|
2022-08-03 14:16:19 +03:00
|
|
|
const { testPaths } = require("./.eslintrc-test-paths.js");
|
2020-01-21 23:46:06 +03:00
|
|
|
const fs = require("fs");
|
2020-01-25 00:55:04 +03:00
|
|
|
const path = require("path");
|
2019-03-28 12:38:02 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Some configurations have overrides, which can't be specified within overrides,
|
|
|
|
* so we need to remove them.
|
|
|
|
*/
|
|
|
|
function removeOverrides(config) {
|
|
|
|
config = { ...config };
|
|
|
|
delete config.overrides;
|
|
|
|
return config;
|
|
|
|
}
|
|
|
|
|
2020-01-21 23:46:38 +03:00
|
|
|
const ignorePatterns = [
|
2020-01-25 00:55:04 +03:00
|
|
|
...fs
|
|
|
|
.readFileSync(
|
|
|
|
path.join(__dirname, "tools", "rewriting", "ThirdPartyPaths.txt")
|
|
|
|
)
|
2020-01-21 23:46:38 +03:00
|
|
|
.toString("utf-8")
|
|
|
|
.split("\n"),
|
2020-01-25 00:55:04 +03:00
|
|
|
...fs
|
|
|
|
.readFileSync(
|
2022-02-24 06:49:43 +03:00
|
|
|
path.join(
|
|
|
|
__dirname,
|
|
|
|
"devtools",
|
|
|
|
"client",
|
|
|
|
"debugger",
|
|
|
|
"src",
|
|
|
|
".eslintignore"
|
|
|
|
)
|
2020-01-25 00:55:04 +03:00
|
|
|
)
|
2020-01-21 23:46:38 +03:00
|
|
|
.toString("utf-8")
|
|
|
|
.split("\n")
|
|
|
|
.filter(p => p && !p.startsWith("#"))
|
2022-02-23 21:38:26 +03:00
|
|
|
.map(p => `devtools/client/debugger/src/${p}`),
|
2020-01-21 23:46:38 +03:00
|
|
|
];
|
2020-01-21 23:46:06 +03:00
|
|
|
|
2016-10-18 10:38:10 +03:00
|
|
|
module.exports = {
|
2021-04-04 11:05:39 +03:00
|
|
|
parser: "@babel/eslint-parser",
|
2020-03-13 22:15:11 +03:00
|
|
|
parserOptions: {
|
|
|
|
sourceType: "script",
|
|
|
|
babelOptions: {
|
|
|
|
configFile: path.join(__dirname, ".babel-eslint.rc.js"),
|
|
|
|
},
|
|
|
|
},
|
2022-06-09 16:02:15 +03:00
|
|
|
settings: {
|
|
|
|
"import/extensions": [".mjs"],
|
|
|
|
},
|
2020-01-21 23:46:06 +03:00
|
|
|
ignorePatterns,
|
2020-01-24 17:56:09 +03:00
|
|
|
// Ignore eslint configurations in parent directories.
|
|
|
|
root: true,
|
2017-04-25 22:12:21 +03:00
|
|
|
// New rules and configurations should generally be added in
|
|
|
|
// tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js to
|
|
|
|
// allow external repositories that use the plugin to pick them up as well.
|
|
|
|
extends: ["plugin:mozilla/recommended"],
|
2022-06-09 16:02:15 +03:00
|
|
|
plugins: ["mozilla", "import"],
|
2017-10-09 12:54:16 +03:00
|
|
|
overrides: [
|
2020-03-07 12:30:44 +03:00
|
|
|
{
|
|
|
|
// All .eslintrc.js files are in the node environment, so turn that
|
|
|
|
// on here.
|
|
|
|
// https://github.com/eslint/eslint/issues/13008
|
|
|
|
files: [".eslintrc.js"],
|
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
browser: false,
|
|
|
|
},
|
|
|
|
},
|
2017-10-09 12:54:16 +03:00
|
|
|
{
|
2022-06-09 16:02:15 +03:00
|
|
|
files: ["*.mjs"],
|
|
|
|
rules: {
|
|
|
|
"import/default": "error",
|
|
|
|
"import/export": "error",
|
|
|
|
"import/named": "error",
|
|
|
|
"import/namespace": "error",
|
|
|
|
"import/newline-after-import": "error",
|
|
|
|
"import/no-anonymous-default-export": "error",
|
|
|
|
"import/no-duplicates": "error",
|
|
|
|
"import/no-absolute-path": "error",
|
|
|
|
"import/no-named-default": "error",
|
|
|
|
"import/no-named-as-default": "error",
|
|
|
|
"import/no-named-as-default-member": "error",
|
|
|
|
"import/no-self-import": "error",
|
|
|
|
"import/no-unassigned-import": "error",
|
2022-07-29 11:10:05 +03:00
|
|
|
"import/no-unresolved": [
|
|
|
|
"error",
|
|
|
|
// Bug 1773473 - Ignore resolver URLs for chrome and resource as we
|
|
|
|
// do not yet have a resolver for them.
|
|
|
|
{ ignore: ["chrome://", "resource://"] },
|
|
|
|
],
|
2022-06-09 16:02:15 +03:00
|
|
|
"import/no-useless-path-segments": "error",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: [
|
|
|
|
// Bug 1773475 - For now, turn off no-unresolved on some paths where we import
|
|
|
|
// from node_modules, as the ESLint setup only installs modules at the
|
|
|
|
// top-level.
|
|
|
|
"devtools/shared/compatibility/**",
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
"import/no-unresolved": "off",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-08-03 09:38:06 +03:00
|
|
|
files: ["*.html", "*.xhtml", "*.xml"],
|
2020-03-07 13:09:44 +03:00
|
|
|
rules: {
|
2019-09-04 19:33:11 +03:00
|
|
|
// Curly brackets are required for all the tree via recommended.js,
|
2019-03-28 12:38:02 +03:00
|
|
|
// however these files aren't auto-fixable at the moment.
|
2020-03-07 13:09:44 +03:00
|
|
|
curly: "off",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2018-12-27 12:45:01 +03:00
|
|
|
// TODO: Bug 1515949. Enable no-undef for gfx/
|
2019-09-04 19:33:11 +03:00
|
|
|
files: "gfx/layers/apz/test/mochitest/**",
|
|
|
|
rules: {
|
|
|
|
"no-undef": "off",
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2019-09-04 19:33:11 +03:00
|
|
|
...removeOverrides(xpcshellTestConfig),
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.xpcshell.map(path => `${path}**`),
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
{
|
2019-09-04 19:33:11 +03:00
|
|
|
// If it is an xpcshell head file, we turn off global unused variable checks, as it
|
|
|
|
// would require searching the other test files to know if they are used or not.
|
|
|
|
// This would be expensive and slow, and it isn't worth it for head files.
|
|
|
|
// We could get developers to declare as exported, but that doesn't seem worth it.
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.xpcshell.map(path => `${path}head*.js`),
|
2020-03-07 13:09:44 +03:00
|
|
|
rules: {
|
2019-09-04 19:33:11 +03:00
|
|
|
"no-unused-vars": [
|
2020-03-07 13:09:44 +03:00
|
|
|
"error",
|
|
|
|
{
|
2019-03-28 12:38:02 +03:00
|
|
|
args: "none",
|
|
|
|
vars: "local",
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2021-10-11 14:07:02 +03:00
|
|
|
{
|
|
|
|
// This section enables warning of no-unused-vars globally for all test*.js
|
|
|
|
// files in xpcshell test paths.
|
|
|
|
// These are turned into errors with selected exclusions in the next
|
|
|
|
// section.
|
|
|
|
// Bug 1612907: This section should go away once the exclusions are removed
|
|
|
|
// from the following section.
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.xpcshell.map(path => `${path}test*.js`),
|
2021-10-11 14:07:02 +03:00
|
|
|
rules: {
|
|
|
|
// No declaring variables that are never used
|
|
|
|
"no-unused-vars": [
|
|
|
|
"warn",
|
|
|
|
{
|
|
|
|
args: "none",
|
|
|
|
vars: "all",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// This section makes global issues with no-unused-vars be reported as
|
|
|
|
// errors - except for the excluded lists which are being fixed in the
|
|
|
|
// dependencies of bug 1612907.
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.xpcshell.map(path => `${path}test*.js`),
|
2021-10-11 14:07:02 +03:00
|
|
|
excludedFiles: [
|
|
|
|
// These are suitable as good first bugs, take one or two related lines
|
|
|
|
// per bug.
|
|
|
|
"extensions/permissions/**",
|
|
|
|
"image/test/unit/**",
|
|
|
|
"modules/libjar/test/unit/test_empty_jar_telemetry.js",
|
|
|
|
"modules/libjar/zipwriter/test/unit/test_alignment.js",
|
|
|
|
"modules/libjar/zipwriter/test/unit/test_bug419769_2.js",
|
|
|
|
"modules/libjar/zipwriter/test/unit/test_storedata.js",
|
|
|
|
"modules/libjar/zipwriter/test/unit/test_zippermissions.js",
|
|
|
|
"modules/libpref/test/unit/test_dirtyPrefs.js",
|
|
|
|
"toolkit/crashreporter/test/unit/test_crash_AsyncShutdown.js",
|
|
|
|
"toolkit/mozapps/update/tests/unit_aus_update/testConstants.js",
|
|
|
|
|
|
|
|
// These are more complicated bugs which may require some in-depth
|
|
|
|
// investigation or different solutions. They are also likely to be
|
|
|
|
// a reasonable size.
|
2022-08-24 00:10:13 +03:00
|
|
|
"dom/indexedDB/**",
|
2021-10-11 14:07:02 +03:00
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
// No declaring variables that are never used
|
|
|
|
"no-unused-vars": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
args: "none",
|
|
|
|
vars: "all",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-03-07 13:09:44 +03:00
|
|
|
{
|
2019-03-28 12:38:02 +03:00
|
|
|
...browserTestConfig,
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.browser.map(path => `${path}**`),
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
{
|
2019-03-28 12:38:02 +03:00
|
|
|
...removeOverrides(mochitestTestConfig),
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.mochitest.map(path => `${path}**`),
|
2021-03-29 22:49:12 +03:00
|
|
|
excludedFiles: ["security/manager/ssl/tests/mochitest/browser/**"],
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
{
|
2019-09-04 19:33:11 +03:00
|
|
|
...removeOverrides(chromeTestConfig),
|
2022-08-03 14:16:19 +03:00
|
|
|
files: testPaths.chrome.map(path => `${path}**`),
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
{
|
2019-09-04 19:33:11 +03:00
|
|
|
env: {
|
2019-03-28 12:38:02 +03:00
|
|
|
// Ideally we wouldn't be using the simpletest env here, but our uses of
|
2019-09-04 19:33:11 +03:00
|
|
|
// js files mean we pick up everything from the global scope, which could
|
|
|
|
// be any one of a number of html files. So we just allow the basics...
|
|
|
|
"mozilla/simpletest": true,
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
files: [
|
2022-08-03 14:16:19 +03:00
|
|
|
...testPaths.mochitest.map(path => `${path}/**/*.js`),
|
|
|
|
...testPaths.chrome.map(path => `${path}/**/*.js`),
|
2020-03-07 13:09:44 +03:00
|
|
|
],
|
2019-09-04 19:33:11 +03:00
|
|
|
},
|
2018-12-27 12:45:01 +03:00
|
|
|
{
|
2022-08-16 11:10:39 +03:00
|
|
|
files: ["netwerk/test/mochitests/**", "netwerk/test/unit*/**"],
|
2018-12-27 12:45:01 +03:00
|
|
|
rules: {
|
2022-08-16 11:10:39 +03:00
|
|
|
"no-shadow": "warn",
|
2019-03-28 12:38:02 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ["layout/**"],
|
2020-03-07 13:09:44 +03:00
|
|
|
rules: {
|
2019-03-28 12:38:02 +03:00
|
|
|
"object-shorthand": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"mozilla/avoid-removeChild": "off",
|
2019-03-28 12:38:02 +03:00
|
|
|
"mozilla/consistent-if-bracing": "off",
|
|
|
|
"mozilla/reject-importGlobalProperties": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"mozilla/no-arbitrary-setTimeout": "off",
|
2019-03-28 12:38:02 +03:00
|
|
|
"mozilla/no-define-cc-etc": "off",
|
2022-08-26 16:39:39 +03:00
|
|
|
"mozilla/prefer-boolean-length-check": "off",
|
2019-03-28 12:38:02 +03:00
|
|
|
"mozilla/use-chromeutils-generateqi": "off",
|
|
|
|
"mozilla/use-default-preference-values": "off",
|
|
|
|
"mozilla/use-includes-instead-of-indexOf": "off",
|
|
|
|
"mozilla/use-services": "off",
|
|
|
|
"mozilla/use-ownerGlobal": "off",
|
|
|
|
complexity: "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"consistent-return": "off",
|
2019-03-28 12:38:02 +03:00
|
|
|
"no-array-constructor": "off",
|
|
|
|
"no-caller": "off",
|
|
|
|
"no-cond-assign": "off",
|
|
|
|
"no-extra-boolean-cast": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"no-eval": "off",
|
|
|
|
"no-func-assign": "off",
|
|
|
|
"no-global-assign": "off",
|
|
|
|
"no-implied-eval": "off",
|
|
|
|
"no-lonely-if": "off",
|
2019-03-28 12:38:02 +03:00
|
|
|
"no-nested-ternary": "off",
|
|
|
|
"no-new-wrappers": "off",
|
|
|
|
"no-redeclare": "off",
|
|
|
|
"no-restricted-globals": "off",
|
|
|
|
"no-return-await": "off",
|
|
|
|
"no-sequences": "off",
|
|
|
|
"no-throw-literal": "off",
|
|
|
|
"no-useless-concat": "off",
|
|
|
|
"no-undef": "off",
|
|
|
|
"no-unreachable": "off",
|
|
|
|
"no-unsanitized/method": "off",
|
|
|
|
"no-unsanitized/property": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"no-unsafe-negation": "off",
|
2019-03-28 12:38:02 +03:00
|
|
|
"no-unused-vars": "off",
|
|
|
|
"no-useless-return": "off",
|
|
|
|
},
|
|
|
|
},
|
2020-03-07 13:09:44 +03:00
|
|
|
{
|
2019-03-28 12:38:02 +03:00
|
|
|
files: [
|
2022-08-21 21:19:44 +03:00
|
|
|
"dom/animation/test/**",
|
2019-03-28 12:38:02 +03:00
|
|
|
"dom/base/test/*.*",
|
2019-05-29 13:50:37 +03:00
|
|
|
"dom/base/test/unit/test_serializers_entities*.js",
|
|
|
|
"dom/base/test/unit_ipc/**",
|
|
|
|
"dom/base/test/jsmodules/**",
|
2022-08-21 21:19:44 +03:00
|
|
|
"dom/canvas/test/**",
|
|
|
|
"dom/encoding/test/**",
|
|
|
|
"dom/events/test/**",
|
|
|
|
"dom/fetch/tests/**",
|
|
|
|
"dom/file/ipc/tests/**",
|
|
|
|
"dom/file/tests/**",
|
|
|
|
"dom/html/test/**",
|
|
|
|
"dom/jsurl/test/**",
|
2019-05-29 13:50:37 +03:00
|
|
|
"dom/media/tests/**",
|
2022-08-21 21:19:44 +03:00
|
|
|
"dom/media/webaudio/test/**",
|
2020-10-02 19:29:35 +03:00
|
|
|
"dom/media/webrtc/tests/**",
|
2022-08-21 21:19:44 +03:00
|
|
|
"dom/media/webspeech/recognition/test/**",
|
|
|
|
"dom/media/webspeech/synth/test/**",
|
|
|
|
"dom/messagechannel/tests/**",
|
|
|
|
"dom/midi/tests/**",
|
|
|
|
"dom/network/tests/**",
|
|
|
|
"dom/payments/test/**",
|
|
|
|
"dom/performance/tests/**",
|
2022-05-03 14:38:15 +03:00
|
|
|
"dom/quota/test/browser/**",
|
|
|
|
"dom/quota/test/common/**",
|
|
|
|
"dom/quota/test/mochitest/**",
|
|
|
|
"dom/quota/test/xpcshell/**",
|
2019-05-29 13:50:37 +03:00
|
|
|
"dom/security/test/cors/**",
|
|
|
|
"dom/security/test/csp/**",
|
|
|
|
"dom/security/test/mixedcontentblocker/**",
|
2022-08-21 21:19:44 +03:00
|
|
|
"dom/serviceworkers/test/**",
|
|
|
|
"dom/smil/test/**",
|
2019-11-14 23:25:21 +03:00
|
|
|
"dom/tests/mochitest/**",
|
2022-08-21 21:19:44 +03:00
|
|
|
"dom/u2f/tests/**",
|
|
|
|
"dom/vr/test/**",
|
|
|
|
"dom/webauthn/tests/**",
|
|
|
|
"dom/webgpu/mochitest/**",
|
|
|
|
"dom/websocket/tests/**",
|
|
|
|
"dom/workers/test/**",
|
|
|
|
"dom/worklet/tests/**",
|
|
|
|
"dom/xml/test/**",
|
|
|
|
"dom/xslt/tests/**",
|
|
|
|
"dom/xul/test/**",
|
2019-05-29 13:50:49 +03:00
|
|
|
"dom/ipc/test.xhtml",
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
"consistent-return": "off",
|
|
|
|
"mozilla/avoid-removeChild": "off",
|
|
|
|
"mozilla/consistent-if-bracing": "off",
|
|
|
|
"mozilla/no-arbitrary-setTimeout": "off",
|
|
|
|
"mozilla/no-compare-against-boolean-literals": "off",
|
|
|
|
"mozilla/no-define-cc-etc": "off",
|
|
|
|
"mozilla/reject-importGlobalProperties": "off",
|
|
|
|
"mozilla/use-cc-etc": "off",
|
|
|
|
"mozilla/use-chromeutils-generateqi": "off",
|
|
|
|
"mozilla/use-includes-instead-of-indexOf": "off",
|
2019-06-13 23:21:46 +03:00
|
|
|
"mozilla/use-ownerGlobal": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"mozilla/use-services": "off",
|
2019-11-14 23:25:21 +03:00
|
|
|
"no-array-constructor": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"no-caller": "off",
|
|
|
|
"no-cond-assign": "off",
|
|
|
|
"no-control-regex": "off",
|
|
|
|
"no-debugger": "off",
|
|
|
|
"no-else-return": "off",
|
2019-06-13 23:21:46 +03:00
|
|
|
"no-empty": "off",
|
|
|
|
"no-eval": "off",
|
|
|
|
"no-func-assign": "off",
|
2019-05-29 13:50:49 +03:00
|
|
|
"no-global-assign": "off",
|
2019-06-13 23:21:46 +03:00
|
|
|
"no-implied-eval": "off",
|
|
|
|
"no-lone-blocks": "off",
|
|
|
|
"no-lonely-if": "off",
|
|
|
|
"no-nested-ternary": "off",
|
|
|
|
"no-new-object": "off",
|
|
|
|
"no-new-wrappers": "off",
|
|
|
|
"no-redeclare": "off",
|
|
|
|
"no-return-await": "off",
|
|
|
|
"no-restricted-globals": "off",
|
|
|
|
"no-self-assign": "off",
|
|
|
|
"no-self-compare": "off",
|
|
|
|
"no-sequences": "off",
|
|
|
|
"no-shadow": "off",
|
|
|
|
"no-shadow-restricted-names": "off",
|
|
|
|
"no-sparse-arrays": "off",
|
|
|
|
"no-throw-literal": "off",
|
|
|
|
"no-unreachable": "off",
|
|
|
|
"no-unsanitized/method": "off",
|
|
|
|
"no-unsanitized/property": "off",
|
|
|
|
"no-undef": "off",
|
2019-10-16 19:59:02 +03:00
|
|
|
"no-unused-vars": "off",
|
2019-06-13 23:21:46 +03:00
|
|
|
"no-useless-call": "off",
|
|
|
|
"no-useless-concat": "off",
|
|
|
|
"no-useless-return": "off",
|
|
|
|
"no-with": "off",
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
},
|
2019-08-21 22:08:44 +03:00
|
|
|
{
|
|
|
|
files: [
|
|
|
|
"testing/mochitest/browser-harness.xhtml",
|
|
|
|
"testing/mochitest/chrome/test_chromeGetTestFile.xhtml",
|
2019-10-15 01:24:12 +03:00
|
|
|
"testing/mochitest/chrome/test_sanityEventUtils.xhtml",
|
|
|
|
"testing/mochitest/chrome/test_sanityException.xhtml",
|
|
|
|
"testing/mochitest/chrome/test_sanityException2.xhtml",
|
|
|
|
"testing/mochitest/harness.xhtml",
|
2020-03-07 13:09:44 +03:00
|
|
|
],
|
2019-10-15 01:24:12 +03:00
|
|
|
rules: {
|
|
|
|
"dot-notation": "off",
|
|
|
|
"object-shorthand": "off",
|
|
|
|
"mozilla/use-services": "off",
|
|
|
|
"mozilla/no-compare-against-boolean-literals": "off",
|
|
|
|
"mozilla/no-useless-parameters": "off",
|
|
|
|
"mozilla/no-useless-removeEventListener": "off",
|
|
|
|
"mozilla/use-cc-etc": "off",
|
2019-10-16 19:59:02 +03:00
|
|
|
"consistent-return": "off",
|
2019-10-15 01:24:12 +03:00
|
|
|
"no-fallthrough": "off",
|
|
|
|
"no-nested-ternary": "off",
|
|
|
|
"no-redeclare": "off",
|
2019-10-16 19:59:02 +03:00
|
|
|
"no-sequences": "off",
|
2019-10-15 01:24:12 +03:00
|
|
|
"no-shadow": "off",
|
|
|
|
"no-throw-literal": "off",
|
|
|
|
"no-undef": "off",
|
2019-12-02 22:16:22 +03:00
|
|
|
"no-unsanitized/property": "off",
|
2019-10-15 01:24:12 +03:00
|
|
|
"no-unused-vars": "off",
|
2019-06-13 23:21:46 +03:00
|
|
|
"no-useless-call": "off",
|
2019-10-15 01:24:12 +03:00
|
|
|
},
|
2019-10-16 19:59:02 +03:00
|
|
|
},
|
2020-03-07 13:09:44 +03:00
|
|
|
{
|
2019-11-20 22:05:30 +03:00
|
|
|
files: [
|
|
|
|
"dom/base/test/chrome/file_bug1139964.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug549682.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug616841.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug990812-1.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug990812-2.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug990812-3.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug990812-4.xhtml",
|
|
|
|
"dom/base/test/chrome/file_bug990812-5.xhtml",
|
2019-11-27 18:39:16 +03:00
|
|
|
"dom/base/test/chrome/file_bug990812.xhtml",
|
2019-11-20 22:05:30 +03:00
|
|
|
"dom/base/test/chrome/test_bug1098074_throw_from_ReceiveMessage.xhtml",
|
2019-11-27 18:39:16 +03:00
|
|
|
"dom/base/test/chrome/test_bug339494.xhtml",
|
|
|
|
"dom/base/test/chrome/test_bug429785.xhtml",
|
|
|
|
"dom/base/test/chrome/test_bug467123.xhtml",
|
|
|
|
"dom/base/test/chrome/test_bug683852.xhtml",
|
|
|
|
"dom/base/test/chrome/test_bug780529.xhtml",
|
|
|
|
"dom/base/test/chrome/test_bug800386.xhtml",
|
|
|
|
"dom/base/test/chrome/test_bug884693.xhtml",
|
2019-11-20 22:05:30 +03:00
|
|
|
"dom/base/test/chrome/test_document-element-inserted.xhtml",
|
|
|
|
"dom/base/test/chrome/test_domparsing.xhtml",
|
|
|
|
"dom/base/test/chrome/title_window.xhtml",
|
|
|
|
"dom/base/test/chrome/window_nsITextInputProcessor.xhtml",
|
|
|
|
"dom/base/test/chrome/window_swapFrameLoaders.xhtml",
|
|
|
|
"dom/base/test/test_domrequesthelper.xhtml",
|
|
|
|
"dom/bindings/test/test_bug1123516_maplikesetlikechrome.xhtml",
|
|
|
|
"dom/console/tests/test_jsm.xhtml",
|
|
|
|
"dom/events/test/test_bug1412775.xhtml",
|
|
|
|
"dom/events/test/test_bug336682_2.xhtml",
|
|
|
|
"dom/events/test/test_bug415498.xhtml",
|
2019-11-27 18:39:16 +03:00
|
|
|
"dom/events/test/test_bug602962.xhtml",
|
|
|
|
"dom/events/test/test_bug617528.xhtml",
|
|
|
|
"dom/events/test/test_bug679494.xhtml",
|
|
|
|
"dom/indexedDB/test/test_globalObjects_chrome.xhtml",
|
|
|
|
"dom/indexedDB/test/test_wrappedArray.xhtml",
|
|
|
|
"dom/ipc/test.xhtml",
|
|
|
|
"dom/ipc/tests/test_process_error.xhtml",
|
|
|
|
"dom/notification/test/chrome/test_notification_system_principal.xhtml",
|
|
|
|
"dom/security/test/general/test_bug1277803.xhtml",
|
|
|
|
"dom/serviceworkers/test/test_serviceworkerinfo.xhtml",
|
|
|
|
"dom/serviceworkers/test/test_serviceworkermanager.xhtml",
|
|
|
|
"dom/system/tests/test_constants.xhtml",
|
|
|
|
"dom/tests/mochitest/chrome/DOMWindowCreated_chrome.xhtml",
|
|
|
|
"dom/tests/mochitest/chrome/MozDomFullscreen_chrome.xhtml",
|
|
|
|
"dom/tests/mochitest/chrome/sizemode_attribute.xhtml",
|
|
|
|
"dom/tests/mochitest/chrome/test_cyclecollector.xhtml",
|
|
|
|
"dom/tests/mochitest/chrome/test_docshell_swap.xhtml",
|
|
|
|
"dom/tests/mochitest/chrome/window_focus.xhtml",
|
|
|
|
"dom/url/tests/test_bug883784.xhtml",
|
|
|
|
"dom/workers/test/test_WorkerDebugger.xhtml",
|
|
|
|
"dom/workers/test/test_WorkerDebugger_console.xhtml",
|
|
|
|
"dom/workers/test/test_fileReadSlice.xhtml",
|
|
|
|
"dom/workers/test/test_fileReaderSync.xhtml",
|
|
|
|
"dom/workers/test/test_fileSlice.xhtml",
|
2020-03-07 13:09:44 +03:00
|
|
|
],
|
|
|
|
rules: {
|
2019-11-27 18:39:16 +03:00
|
|
|
"mozilla/no-useless-parameters": "off",
|
|
|
|
"mozilla/no-useless-removeEventListener": "off",
|
|
|
|
"mozilla/use-chromeutils-generateqi": "off",
|
|
|
|
"mozilla/use-services": "off",
|
|
|
|
complexity: "off",
|
|
|
|
"no-array-constructor": "off",
|
|
|
|
"no-caller": "off",
|
|
|
|
"no-empty": "off",
|
|
|
|
"no-eval": "off",
|
|
|
|
"no-lone-blocks": "off",
|
|
|
|
"no-redeclare": "off",
|
|
|
|
"no-shadow": "off",
|
|
|
|
"no-throw-literal": "off",
|
|
|
|
"no-unsanitized/method": "off",
|
|
|
|
"no-useless-return": "off",
|
|
|
|
"object-shorthand": "off",
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-09-02 14:05:17 +03:00
|
|
|
files: ["netwerk/**"],
|
2020-03-07 13:09:44 +03:00
|
|
|
rules: {
|
2019-10-16 23:11:31 +03:00
|
|
|
"mozilla/prefer-boolean-length-check": "off",
|
2020-03-07 13:09:44 +03:00
|
|
|
},
|
|
|
|
},
|
2022-03-25 21:01:21 +03:00
|
|
|
{
|
|
|
|
// Rules of Hooks broadly checks for camelCase "use" identifiers, so
|
|
|
|
// enable only for paths actually using React to avoid false positives.
|
|
|
|
extends: ["plugin:react-hooks/recommended"],
|
|
|
|
files: [
|
|
|
|
"browser/components/newtab/**",
|
|
|
|
"browser/components/pocket/**",
|
|
|
|
"devtools/**",
|
|
|
|
],
|
|
|
|
},
|
2022-06-10 00:05:38 +03:00
|
|
|
{
|
|
|
|
// Turn off the osfile rule for osfile.
|
|
|
|
files: ["toolkit/components/osfile/**"],
|
|
|
|
rules: {
|
|
|
|
"mozilla/reject-osfile": "off",
|
|
|
|
},
|
|
|
|
},
|
2020-03-07 13:09:44 +03:00
|
|
|
],
|
2016-10-18 10:38:10 +03:00
|
|
|
};
|