Bug 1881701 - 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
Differential Revision: https://phabricator.services.mozilla.com/D249951
This commit is contained in:
committed by
mbanner@mozilla.com
parent
876c545813
commit
0dae27506b
@@ -1,6 +1,9 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
rules: {
|
rules: {
|
||||||
"mozilla/no-aArgs": "error",
|
"mozilla/no-aArgs": "error",
|
||||||
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
||||||
@@ -24,4 +27,5 @@ module.exports = {
|
|||||||
yoda: "error",
|
yoda: "error",
|
||||||
"no-undef-init": "error",
|
"no-undef-init": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// XXX These are rules that are enabled in the recommended configuration, but
|
// XXX These are rules that are enabled in the recommended configuration, but
|
||||||
// disabled here due to failures when initially implemented. They should be
|
// disabled here due to failures when initially implemented. They should be
|
||||||
// removed (and hence enabled) at some stage.
|
// removed (and hence enabled) at some stage.
|
||||||
"no-nested-ternary": "off",
|
"no-nested-ternary": "off",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
// Bug 1602061 TODO: These tests access DOM elements via
|
// Bug 1602061 TODO: These tests access DOM elements via
|
||||||
@@ -20,5 +22,4 @@ module.exports = {
|
|||||||
"no-undef": "off",
|
"no-undef": "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
// eslint-plugin-html doesn't automatically detect module sections in
|
// eslint-plugin-html doesn't automatically detect module sections in
|
||||||
// html files. Enable these as a module here. JavaScript files can use
|
// html files. Enable these as a module here. JavaScript files can use
|
||||||
// the mjs extension.
|
// the mjs extension.
|
||||||
files: ["*.html"],
|
files: ["**/*.html"],
|
||||||
parserOptions: {
|
languageOptions: {
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
export default [
|
||||||
|
{
|
||||||
module.exports = {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
Assert: true,
|
Assert: true,
|
||||||
exported_symbols: true,
|
exported_symbols: true,
|
||||||
require_module: true,
|
require_module: true,
|
||||||
Utils: true,
|
Utils: true,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -3,10 +3,12 @@
|
|||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
worker: true,
|
languageOptions: {
|
||||||
|
globals: globals.worker,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -3,10 +3,12 @@
|
|||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
worker: true,
|
languageOptions: {
|
||||||
|
globals: globals.worker,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
// Globals from mediasource.js. We use false to indicate they should not
|
// Globals from mediasource.js. We use false to indicate they should not
|
||||||
// be overwritten in scripts.
|
// be overwritten in scripts.
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
addMSEPrefs: false,
|
addMSEPrefs: false,
|
||||||
fetchAndLoad: false,
|
fetchAndLoad: false,
|
||||||
@@ -20,9 +24,11 @@ module.exports = {
|
|||||||
wait: false,
|
wait: false,
|
||||||
waitUntilTime: false,
|
waitUntilTime: false,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
// Use const/let instead of var for tighter scoping, avoiding redeclaration
|
// Use const/let instead of var for tighter scoping, avoiding redeclaration
|
||||||
rules: {
|
rules: {
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
"prefer-const": "error",
|
"prefer-const": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -3,19 +3,12 @@
|
|||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
|
||||||
worker: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
files: ["head.js"],
|
languageOptions: {
|
||||||
env: {
|
globals: globals.worker,
|
||||||
worker: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,48 +2,15 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import spidermonkeyJS from "eslint-plugin-spidermonkey-js";
|
||||||
|
import mozilla from "eslint-plugin-mozilla";
|
||||||
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
plugins: ["spidermonkey-js"],
|
|
||||||
|
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
files: ["*.js"],
|
plugins: { "spidermonkey-js": spidermonkeyJS },
|
||||||
excludedFiles: ".eslintrc.js",
|
files: ["**/*.js"],
|
||||||
processor: "spidermonkey-js/processor",
|
processor: "spidermonkey-js/processor",
|
||||||
env: {
|
|
||||||
// Disable all built-in environments.
|
|
||||||
node: false,
|
|
||||||
browser: false,
|
|
||||||
builtin: false,
|
|
||||||
|
|
||||||
// We need to explicitly disable the default environments added from
|
|
||||||
// "tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js".
|
|
||||||
es2021: false,
|
|
||||||
"mozilla/privileged": false,
|
|
||||||
"mozilla/specific": false,
|
|
||||||
|
|
||||||
// Enable SpiderMonkey's self-hosted environment.
|
|
||||||
"spidermonkey-js/environment": true,
|
|
||||||
},
|
|
||||||
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: "latest",
|
|
||||||
sourceType: "script",
|
|
||||||
|
|
||||||
// Self-hosted code defaults to strict mode.
|
|
||||||
ecmaFeatures: {
|
|
||||||
impliedStrict: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
// Strict mode has to be enabled separately for the Babel parser.
|
|
||||||
babelOptions: {
|
|
||||||
parserOpts: {
|
|
||||||
strictMode: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
// We should fix those at some point, but we use this to detect NaNs.
|
// We should fix those at some point, but we use this to detect NaNs.
|
||||||
@@ -114,11 +81,13 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
selector: "VariableDeclaration[kind='let']",
|
selector: "VariableDeclaration[kind='let']",
|
||||||
message: "'let' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
message:
|
||||||
|
"'let' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
selector: "VariableDeclaration[kind='const']",
|
selector: "VariableDeclaration[kind='const']",
|
||||||
message: "'const' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
message:
|
||||||
|
"'const' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// Method signatures are important in builtins so disable unused argument errors.
|
// Method signatures are important in builtins so disable unused argument errors.
|
||||||
@@ -131,7 +100,39 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: "latest",
|
||||||
|
|
||||||
|
// Self-hosted code defaults to strict mode.
|
||||||
|
ecmaFeatures: {
|
||||||
|
impliedStrict: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
// Strict mode has to be enabled separately for the Babel parser.
|
||||||
|
babelOptions: {
|
||||||
|
parserOpts: {
|
||||||
|
strictMode: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
sourceType: "script",
|
||||||
globals: {
|
globals: {
|
||||||
|
// Disable all built-in environments.
|
||||||
|
...mozilla.turnOff(globals.node),
|
||||||
|
...mozilla.turnOff(globals.browser),
|
||||||
|
...mozilla.turnOff(globals.builtin),
|
||||||
|
|
||||||
|
// We need to explicitly disable the default environments added from
|
||||||
|
// "tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js".
|
||||||
|
...mozilla.turnOff(globals.es2021),
|
||||||
|
...mozilla.turnOff(mozilla.environments.privileged.globals),
|
||||||
|
...mozilla.turnOff(mozilla.environments.specific.globals),
|
||||||
|
|
||||||
|
// Enable SpiderMonkey's self-hosted environment.
|
||||||
|
...spidermonkeyJS.environments.environment.globals,
|
||||||
|
|
||||||
// The bytecode compiler special-cases these identifiers.
|
// The bytecode compiler special-cases these identifiers.
|
||||||
ArgumentsLength: "readonly",
|
ArgumentsLength: "readonly",
|
||||||
allowContentIter: "readonly",
|
allowContentIter: "readonly",
|
||||||
@@ -173,5 +174,5 @@ module.exports = {
|
|||||||
Tuple: "off",
|
Tuple: "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -2,19 +2,15 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import config from "../../toolkit/components/extensions/parent/.eslintrc.mjs";
|
||||||
|
|
||||||
const {
|
export default [
|
||||||
globals,
|
|
||||||
} = require("../../toolkit/components/extensions/parent/.eslintrc.js");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
files: ["components/extensions/ext-*.js"],
|
files: ["components/extensions/ext-*.js"],
|
||||||
excludedFiles: ["components/extensions/ext-c-*.js"],
|
ignores: ["components/extensions/ext-c-*.js"],
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
...globals,
|
...config[0].globals,
|
||||||
// These globals are defined in ext-android.js and can only be used in
|
// These globals are defined in ext-android.js and can only be used in
|
||||||
// the extension files that run in the parent process.
|
// the extension files that run in the parent process.
|
||||||
EventDispatcher: true,
|
EventDispatcher: true,
|
||||||
@@ -25,6 +21,7 @@ module.exports = {
|
|||||||
windowTracker: true,
|
windowTracker: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
"chrome/geckoview/**",
|
"chrome/geckoview/**",
|
||||||
@@ -69,5 +66,4 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import mozilla from "eslint-plugin-mozilla";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
plugins: { mozilla },
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
rules: {
|
rules: {
|
||||||
// Rules from the mozilla plugin
|
// Rules from the mozilla plugin
|
||||||
"mozilla/balanced-listeners": "error",
|
"mozilla/balanced-listeners": "error",
|
||||||
@@ -73,4 +76,5 @@ module.exports = {
|
|||||||
// Disallow function or variable declarations in nested blocks
|
// Disallow function or variable declarations in nested blocks
|
||||||
"no-inner-declarations": "error",
|
"no-inner-declarations": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
webextensions: true,
|
languageOptions: {
|
||||||
|
globals: globals.webextensions,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
webextensions: true,
|
languageOptions: {
|
||||||
|
globals: globals.webextensions,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
export default [
|
||||||
|
{
|
||||||
module.exports = {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
Bookmarks: false,
|
Bookmarks: false,
|
||||||
EnableEngines: false,
|
EnableEngines: false,
|
||||||
@@ -12,4 +12,6 @@ module.exports = {
|
|||||||
Phase: false,
|
Phase: false,
|
||||||
Sync: false,
|
Sync: false,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
import globals from "globals";
|
||||||
env: {
|
|
||||||
webextensions: true,
|
export default [
|
||||||
},
|
{
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
|
...globals.webextensions,
|
||||||
ExtensionAPI: true,
|
ExtensionAPI: true,
|
||||||
// available to frameScripts
|
// available to frameScripts
|
||||||
addMessageListener: false,
|
addMessageListener: false,
|
||||||
content: false,
|
content: false,
|
||||||
sendAsyncMessage: false,
|
sendAsyncMessage: false,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
export default [
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
"chrome/geckoview/**",
|
"chrome/geckoview/**",
|
||||||
@@ -50,5 +47,4 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,28 +2,22 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import toolkitConfig from "../../../../toolkit/components/extensions/.eslintrc.mjs";
|
||||||
|
import parentConfig from "../../../../toolkit/components/extensions/parent/.eslintrc.mjs";
|
||||||
|
import childConfig from "../../../../toolkit/components/extensions/child/.eslintrc.mjs";
|
||||||
|
|
||||||
const {
|
export default [
|
||||||
globals: globalsParent,
|
...toolkitConfig,
|
||||||
} = require("../../../../toolkit/components/extensions/parent/.eslintrc.js");
|
|
||||||
|
|
||||||
const {
|
|
||||||
globals: globalsChild,
|
|
||||||
} = require("../../../../toolkit/components/extensions/child/.eslintrc.js");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
extends: "../../../../toolkit/components/extensions/.eslintrc.js",
|
|
||||||
// Ideally mobile should also follow the convention of
|
// Ideally mobile should also follow the convention of
|
||||||
// parent/ext-*.js for parent scripts and
|
// parent/ext-*.js for parent scripts and
|
||||||
// child/ext-*.js for child scripts,
|
// child/ext-*.js for child scripts,
|
||||||
// but the current file structure predates the parent/ vs child/ separation.
|
// but the current file structure predates the parent/ vs child/ separation.
|
||||||
overrides: [
|
|
||||||
{
|
{
|
||||||
files: ["ext-*.js"],
|
files: ["ext-*.js"],
|
||||||
excludedFiles: ["ext-c-*.js"],
|
ignores: ["ext-c-*.js"],
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
...globalsParent,
|
...parentConfig[0].languageOptions.globals,
|
||||||
// These globals are defined in ext-android.js and can only be used in
|
// These globals are defined in ext-android.js and can only be used in
|
||||||
// the extension files that run in the parent process.
|
// the extension files that run in the parent process.
|
||||||
EventDispatcher: true,
|
EventDispatcher: true,
|
||||||
@@ -34,13 +28,11 @@ module.exports = {
|
|||||||
windowTracker: true,
|
windowTracker: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ["ext-c-*.js"],
|
files: ["ext-c-*.js"],
|
||||||
globals: {
|
|
||||||
...globalsChild,
|
|
||||||
// If there were ever globals exported in ext-c-android.js for common
|
// If there were ever globals exported in ext-c-android.js for common
|
||||||
// use, then they would appear here.
|
// use, then they would appear here.
|
||||||
|
...childConfig[0],
|
||||||
},
|
},
|
||||||
},
|
];
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
import config from "../../../../../../toolkit/components/extensions/test/mochitest/.eslintrc.mjs";
|
||||||
extends:
|
|
||||||
"../../../../../../toolkit/components/extensions/test/mochitest/.eslintrc.js",
|
export default config;
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
import config from "../../../../../../toolkit/components/extensions/test/xpcshell/.eslintrc.mjs";
|
||||||
extends:
|
|
||||||
"../../../../../../toolkit/components/extensions/test/xpcshell/.eslintrc.js",
|
export default config;
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,11 +2,16 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
browser: true,
|
files: ["**/*.js"],
|
||||||
node: true,
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
// inherits from ../../tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
|
// inherits from ../../tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
rules: {
|
rules: {
|
||||||
camelcase: ["error", { properties: "never" }],
|
camelcase: ["error", { properties: "never" }],
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
rules: {
|
rules: {
|
||||||
camelcase: "off",
|
camelcase: "off",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
export default [
|
||||||
|
{
|
||||||
module.exports = {
|
|
||||||
rules: {
|
rules: {
|
||||||
// Enforce return statements in callbacks of array methods.
|
// Enforce return statements in callbacks of array methods.
|
||||||
"array-callback-return": "error",
|
"array-callback-return": "error",
|
||||||
@@ -43,4 +42,5 @@ module.exports = {
|
|||||||
// Disallow Yoda conditions.
|
// Disallow Yoda conditions.
|
||||||
yoda: ["error", "never"],
|
yoda: ["error", "never"],
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Disallow non-top level |var| declarations.
|
// Disallow non-top level |var| declarations.
|
||||||
"mozilla/var-only-at-top-level": "error",
|
"mozilla/var-only-at-top-level": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
export default [
|
||||||
|
{
|
||||||
module.exports = {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
// JS files in this folder are commonly xpcshell scripts where |arguments|
|
// JS files in this folder are commonly xpcshell scripts where |arguments|
|
||||||
// is defined in the global scope.
|
// is defined in the global scope.
|
||||||
arguments: false,
|
arguments: false,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
// Injected into tests via tps.sys.mjs
|
// Injected into tests via tps.sys.mjs
|
||||||
Addons: false,
|
Addons: false,
|
||||||
@@ -25,4 +29,6 @@ module.exports = {
|
|||||||
Windows: false,
|
Windows: false,
|
||||||
WipeServer: false,
|
WipeServer: false,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
node: true,
|
languageOptions: { globals: globals.node },
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
export default [
|
||||||
|
{
|
||||||
module.exports = {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
// JS files in this folder are commonly xpcshell scripts where |arguments|
|
// JS files in this folder are commonly xpcshell scripts where |arguments|
|
||||||
// is defined in the global scope.
|
// is defined in the global scope.
|
||||||
arguments: false,
|
arguments: false,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// Enforce return statements in callbacks of array methods.
|
// Enforce return statements in callbacks of array methods.
|
||||||
"array-callback-return": "error",
|
"array-callback-return": "error",
|
||||||
@@ -48,4 +49,5 @@ module.exports = {
|
|||||||
// Disallow Yoda conditions.
|
// Disallow Yoda conditions.
|
||||||
yoda: ["error", "never"],
|
yoda: ["error", "never"],
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
user_pref: true,
|
user_pref: true,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,11 +2,15 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
browser: true,
|
languageOptions: {
|
||||||
node: true,
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,23 +2,23 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
import mozilla from "eslint-plugin-mozilla";
|
||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
webextensions: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
|
...globals.webextensions,
|
||||||
getTestConfig: false,
|
getTestConfig: false,
|
||||||
startMark: true,
|
startMark: true,
|
||||||
endMark: true,
|
endMark: true,
|
||||||
name: true,
|
name: true,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
plugins: ["mozilla"],
|
plugins: { mozilla },
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
"mozilla/avoid-Date-timing": "error",
|
"mozilla/avoid-Date-timing": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import mozilla from "eslint-plugin-mozilla";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
Cc: false,
|
Cc: false,
|
||||||
Ci: false,
|
Ci: false,
|
||||||
@@ -27,10 +29,11 @@ module.exports = {
|
|||||||
TalosParentProfiler: true,
|
TalosParentProfiler: true,
|
||||||
tpRecordTime: true,
|
tpRecordTime: true,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
plugins: ["mozilla"],
|
plugins: { mozilla },
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
"mozilla/avoid-Date-timing": "error",
|
"mozilla/avoid-Date-timing": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
import mozilla from "eslint-plugin-mozilla";
|
||||||
plugins: ["react"],
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
plugins: { mozilla },
|
||||||
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
exports: true,
|
exports: true,
|
||||||
isWorker: true,
|
isWorker: true,
|
||||||
@@ -11,6 +17,7 @@ module.exports = {
|
|||||||
require: true,
|
require: true,
|
||||||
dampWindow: true,
|
dampWindow: true,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"no-unused-vars": ["error", { argsIgnorePattern: "^_", vars: "all" }],
|
"no-unused-vars": ["error", { argsIgnorePattern: "^_", vars: "all" }],
|
||||||
// These are the rules that have been configured so far to match the
|
// These are the rules that have been configured so far to match the
|
||||||
@@ -23,4 +30,5 @@ module.exports = {
|
|||||||
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
||||||
"mozilla/var-only-at-top-level": "error",
|
"mozilla/var-only-at-top-level": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
export default [
|
||||||
{
|
{
|
||||||
"rules": {
|
rules: {
|
||||||
"no-undef": "off"
|
"no-undef": "off",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
export default [
|
||||||
{
|
{
|
||||||
"rules": {
|
rules: {
|
||||||
"no-undef": "off"
|
"no-undef": "off",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,23 +2,20 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
import eslintPlugin from "eslint-plugin-eslint-plugin";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
plugins: ["eslint-plugin"],
|
{
|
||||||
extends: ["plugin:eslint-plugin/recommended"],
|
...eslintPlugin.configs["flat/recommended"],
|
||||||
// eslint-plugin-mozilla runs under node, so we need a more restrictive
|
languageOptions: {
|
||||||
// environment / parser setup here than the rest of mozilla-central.
|
globals: globals.node,
|
||||||
env: {
|
|
||||||
browser: false,
|
|
||||||
node: true,
|
|
||||||
},
|
|
||||||
parser: "espree",
|
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
// This should match with the minimum node version that the ESLint CI
|
// This should match with the minimum node version that the ESLint CI
|
||||||
// process uses (check the linux64-node toolchain).
|
// process uses (check the linux64-node toolchain).
|
||||||
ecmaVersion: 12,
|
ecmaVersion: 12,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
camelcase: ["error", { properties: "never" }],
|
camelcase: ["error", { properties: "never" }],
|
||||||
@@ -27,4 +24,16 @@ module.exports = {
|
|||||||
"one-var": ["error", "never"],
|
"one-var": ["error", "never"],
|
||||||
strict: ["error", "global"],
|
strict: ["error", "global"],
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
{
|
||||||
|
files: ["eslint-plugin-mozilla/scripts/createExports.js"],
|
||||||
|
languageOptions: {
|
||||||
|
sourceType: "script",
|
||||||
|
parserOptions: {
|
||||||
|
ecmaFeatures: {
|
||||||
|
globalReturn: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
"use strict";
|
/* 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/. */
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
|
{
|
||||||
rules: {
|
rules: {
|
||||||
// Require object keys to be sorted.
|
// Require object keys to be sorted.
|
||||||
"sort-keys": "error",
|
"sort-keys": "error",
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
// Dot file to verify that it works
|
// Dot file to verify that it works
|
||||||
// without license
|
// without license
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|||||||
@@ -2,15 +2,17 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
env: {
|
{
|
||||||
jquery: true,
|
languageOptions: {
|
||||||
},
|
|
||||||
globals: {
|
globals: {
|
||||||
|
...globals.jquery,
|
||||||
apply: true,
|
apply: true,
|
||||||
applyChunks: true,
|
applyChunks: true,
|
||||||
tasks: true,
|
tasks: true,
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,17 +2,19 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
"use strict";
|
import eslintPlugin from "eslint-plugin-eslint-plugin";
|
||||||
|
import globals from "globals";
|
||||||
|
|
||||||
module.exports = {
|
export default [
|
||||||
plugins: ["eslint-plugin"],
|
{
|
||||||
extends: ["plugin:eslint-plugin/recommended"],
|
plugins: { "eslint-plugin": eslintPlugin },
|
||||||
env: {
|
...eslintPlugin.configs["flat/recommended"],
|
||||||
browser: false,
|
languageOptions: {
|
||||||
node: true,
|
globals: { ...globals.browser, ...globals.node },
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"no-console": "off",
|
"no-console": "off",
|
||||||
strict: ["error", "global"],
|
strict: ["error", "global"],
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user