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,27 +1,31 @@
|
|||||||
"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: {
|
{
|
||||||
"mozilla/no-aArgs": "error",
|
rules: {
|
||||||
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
"mozilla/no-aArgs": "error",
|
||||||
"mozilla/var-only-at-top-level": "error",
|
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
||||||
|
"mozilla/var-only-at-top-level": "error",
|
||||||
|
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
camelcase: ["error", { properties: "never" }],
|
camelcase: ["error", { properties: "never" }],
|
||||||
complexity: ["error", 20],
|
complexity: ["error", 20],
|
||||||
|
|
||||||
"handle-callback-err": ["error", "er"],
|
"handle-callback-err": ["error", "er"],
|
||||||
"max-nested-callbacks": ["error", 4],
|
"max-nested-callbacks": ["error", 4],
|
||||||
"new-cap": ["error", { capIsNew: false }],
|
"new-cap": ["error", { capIsNew: false }],
|
||||||
"no-fallthrough": "error",
|
"no-fallthrough": "error",
|
||||||
"no-multi-str": "error",
|
"no-multi-str": "error",
|
||||||
"no-proto": "error",
|
"no-proto": "error",
|
||||||
"no-return-assign": "error",
|
"no-return-assign": "error",
|
||||||
"no-unused-vars": ["error", { vars: "all", argsIgnorePattern: "^_" }],
|
"no-unused-vars": ["error", { vars: "all", argsIgnorePattern: "^_" }],
|
||||||
"one-var": ["error", "never"],
|
"one-var": ["error", "never"],
|
||||||
radix: "error",
|
radix: "error",
|
||||||
strict: ["error", "global"],
|
strict: ["error", "global"],
|
||||||
yoda: "error",
|
yoda: "error",
|
||||||
"no-undef-init": "error",
|
"no-undef-init": "error",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
"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: {
|
{
|
||||||
// XXX These are rules that are enabled in the recommended configuration, but
|
rules: {
|
||||||
// disabled here due to failures when initially implemented. They should be
|
// XXX These are rules that are enabled in the recommended configuration, but
|
||||||
// removed (and hence enabled) at some stage.
|
// disabled here due to failures when initially implemented. They should be
|
||||||
"no-nested-ternary": "off",
|
// removed (and hence enabled) at some stage.
|
||||||
},
|
"no-nested-ternary": "off",
|
||||||
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: [
|
|
||||||
// Bug 1602061 TODO: These tests access DOM elements via
|
|
||||||
// id-as-variable-name, which eslint doesn't have support for yet.
|
|
||||||
"attributes/test_listbox.html",
|
|
||||||
"treeupdate/test_ariaowns.html",
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
"no-undef": "off",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
};
|
{
|
||||||
|
files: [
|
||||||
|
// Bug 1602061 TODO: These tests access DOM elements via
|
||||||
|
// id-as-variable-name, which eslint doesn't have support for yet.
|
||||||
|
"attributes/test_listbox.html",
|
||||||
|
"treeupdate/test_ariaowns.html",
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
"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"],
|
languageOptions: {
|
||||||
parserOptions: {
|
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,28 +1,34 @@
|
|||||||
"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
|
{
|
||||||
// be overwritten in scripts.
|
// Globals from mediasource.js. We use false to indicate they should not
|
||||||
globals: {
|
// be overwritten in scripts.
|
||||||
addMSEPrefs: false,
|
languageOptions: {
|
||||||
fetchAndLoad: false,
|
globals: {
|
||||||
fetchAndLoadAsync: false,
|
addMSEPrefs: false,
|
||||||
fetchWithXHR: false,
|
fetchAndLoad: false,
|
||||||
logEvents: false,
|
fetchAndLoadAsync: false,
|
||||||
loadSegment: false,
|
fetchWithXHR: false,
|
||||||
must_not_reject: false,
|
logEvents: false,
|
||||||
must_not_throw: false,
|
loadSegment: false,
|
||||||
must_reject: false,
|
must_not_reject: false,
|
||||||
must_throw: false,
|
must_not_throw: false,
|
||||||
once: false,
|
must_reject: false,
|
||||||
range: false,
|
must_throw: false,
|
||||||
runWithMSE: false,
|
once: false,
|
||||||
wait: false,
|
range: false,
|
||||||
waitUntilTime: false,
|
runWithMSE: false,
|
||||||
|
wait: false,
|
||||||
|
waitUntilTime: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// Use const/let instead of var for tighter scoping, avoiding redeclaration
|
||||||
|
rules: {
|
||||||
|
"no-var": "error",
|
||||||
|
"prefer-const": "error",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// Use const/let instead of var for tighter scoping, avoiding redeclaration
|
];
|
||||||
rules: {
|
|
||||||
"no-var": "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,
|
languageOptions: {
|
||||||
},
|
globals: globals.worker,
|
||||||
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ["head.js"],
|
|
||||||
env: {
|
|
||||||
worker: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -2,35 +2,107 @@
|
|||||||
* 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"],
|
{
|
||||||
|
plugins: { "spidermonkey-js": spidermonkeyJS },
|
||||||
|
files: ["**/*.js"],
|
||||||
|
processor: "spidermonkey-js/processor",
|
||||||
|
|
||||||
overrides: [
|
rules: {
|
||||||
{
|
// We should fix those at some point, but we use this to detect NaNs.
|
||||||
files: ["*.js"],
|
"no-self-compare": "off",
|
||||||
excludedFiles: ".eslintrc.js",
|
"no-lonely-if": "off",
|
||||||
processor: "spidermonkey-js/processor",
|
// Disabled until we can use let/const to fix those erorrs, and undefined
|
||||||
env: {
|
// names cause an exception and abort during runtime initialization.
|
||||||
// Disable all built-in environments.
|
"no-redeclare": "off",
|
||||||
node: false,
|
// Disallow use of |void 0|. Instead use |undefined|.
|
||||||
browser: false,
|
"no-void": ["error", { allowAsStatement: true }],
|
||||||
builtin: false,
|
// Disallow loose equality because of objects with the [[IsHTMLDDA]]
|
||||||
|
// internal slot, aka |document.all|, aka "objects emulating undefined".
|
||||||
// We need to explicitly disable the default environments added from
|
eqeqeq: "error",
|
||||||
// "tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js".
|
// All self-hosted code is implicitly strict mode, so there's no need to
|
||||||
es2021: false,
|
// add a strict-mode directive.
|
||||||
"mozilla/privileged": false,
|
strict: ["error", "never"],
|
||||||
"mozilla/specific": false,
|
// Disallow syntax not supported in self-hosted code.
|
||||||
|
"no-restricted-syntax": [
|
||||||
// Enable SpiderMonkey's self-hosted environment.
|
"error",
|
||||||
"spidermonkey-js/environment": true,
|
{
|
||||||
},
|
selector: "ClassDeclaration",
|
||||||
|
message: "Class declarations are not allowed",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "ClassExpression",
|
||||||
|
message: "Class expressions are not allowed",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "Literal[regex]",
|
||||||
|
message: "Regular expression literals are not allowed",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "CallExpression > MemberExpression.callee",
|
||||||
|
message:
|
||||||
|
"Direct method calls are not allowed, use callFunction() or callContentFunction()",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "NewExpression > MemberExpression.callee",
|
||||||
|
message:
|
||||||
|
"Direct method calls are not allowed, use constructContentFunction()",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "YieldExpression[delegate=true]",
|
||||||
|
message:
|
||||||
|
"yield* is not allowed because it can run user-modifiable iteration code",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "ForOfStatement > :not(CallExpression).right",
|
||||||
|
message:
|
||||||
|
"for-of loops must use allowContentIter(), allowContentIterWith(), or allowContentIterWithNext()",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector:
|
||||||
|
"ForOfStatement > CallExpression.right > :not(Identifier[name='allowContentIter'], Identifier[name='allowContentIterWith'], Identifier[name='allowContentIterWithNext']).callee",
|
||||||
|
message:
|
||||||
|
"for-of loops must use allowContentIter(), allowContentIterWith(), or allowContentIterWithNext",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector:
|
||||||
|
"CallExpression[callee.name='TO_PROPERTY_KEY'] > :not(Identifier).arguments:first-child",
|
||||||
|
message:
|
||||||
|
"TO_PROPERTY_KEY macro must be called with a simple identifier",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "Identifier[name='arguments']",
|
||||||
|
message:
|
||||||
|
"'arguments' is disallowed, use ArgumentsLength(), GetArgument(n), or rest-parameters",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "VariableDeclaration[kind='let']",
|
||||||
|
message:
|
||||||
|
"'let' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
selector: "VariableDeclaration[kind='const']",
|
||||||
|
message:
|
||||||
|
"'const' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// Method signatures are important in builtins so disable unused argument errors.
|
||||||
|
"no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
args: "none",
|
||||||
|
vars: "local",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: "latest",
|
ecmaVersion: "latest",
|
||||||
sourceType: "script",
|
|
||||||
|
|
||||||
// Self-hosted code defaults to strict mode.
|
// Self-hosted code defaults to strict mode.
|
||||||
ecmaFeatures: {
|
ecmaFeatures: {
|
||||||
@@ -45,93 +117,22 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
sourceType: "script",
|
||||||
// We should fix those at some point, but we use this to detect NaNs.
|
|
||||||
"no-self-compare": "off",
|
|
||||||
"no-lonely-if": "off",
|
|
||||||
// Disabled until we can use let/const to fix those erorrs, and undefined
|
|
||||||
// names cause an exception and abort during runtime initialization.
|
|
||||||
"no-redeclare": "off",
|
|
||||||
// Disallow use of |void 0|. Instead use |undefined|.
|
|
||||||
"no-void": ["error", { allowAsStatement: true }],
|
|
||||||
// Disallow loose equality because of objects with the [[IsHTMLDDA]]
|
|
||||||
// internal slot, aka |document.all|, aka "objects emulating undefined".
|
|
||||||
eqeqeq: "error",
|
|
||||||
// All self-hosted code is implicitly strict mode, so there's no need to
|
|
||||||
// add a strict-mode directive.
|
|
||||||
strict: ["error", "never"],
|
|
||||||
// Disallow syntax not supported in self-hosted code.
|
|
||||||
"no-restricted-syntax": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
selector: "ClassDeclaration",
|
|
||||||
message: "Class declarations are not allowed",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "ClassExpression",
|
|
||||||
message: "Class expressions are not allowed",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "Literal[regex]",
|
|
||||||
message: "Regular expression literals are not allowed",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "CallExpression > MemberExpression.callee",
|
|
||||||
message:
|
|
||||||
"Direct method calls are not allowed, use callFunction() or callContentFunction()",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "NewExpression > MemberExpression.callee",
|
|
||||||
message:
|
|
||||||
"Direct method calls are not allowed, use constructContentFunction()",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "YieldExpression[delegate=true]",
|
|
||||||
message:
|
|
||||||
"yield* is not allowed because it can run user-modifiable iteration code",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "ForOfStatement > :not(CallExpression).right",
|
|
||||||
message:
|
|
||||||
"for-of loops must use allowContentIter(), allowContentIterWith(), or allowContentIterWithNext()",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector:
|
|
||||||
"ForOfStatement > CallExpression.right > :not(Identifier[name='allowContentIter'], Identifier[name='allowContentIterWith'], Identifier[name='allowContentIterWithNext']).callee",
|
|
||||||
message:
|
|
||||||
"for-of loops must use allowContentIter(), allowContentIterWith(), or allowContentIterWithNext",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector:
|
|
||||||
"CallExpression[callee.name='TO_PROPERTY_KEY'] > :not(Identifier).arguments:first-child",
|
|
||||||
message:
|
|
||||||
"TO_PROPERTY_KEY macro must be called with a simple identifier",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "Identifier[name='arguments']",
|
|
||||||
message:
|
|
||||||
"'arguments' is disallowed, use ArgumentsLength(), GetArgument(n), or rest-parameters",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "VariableDeclaration[kind='let']",
|
|
||||||
message: "'let' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selector: "VariableDeclaration[kind='const']",
|
|
||||||
message: "'const' declarations are disallowed to avoid TDZ checks, use 'var' instead",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// Method signatures are important in builtins so disable unused argument errors.
|
|
||||||
"no-unused-vars": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
args: "none",
|
|
||||||
vars: "local",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
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");
|
files: ["components/extensions/ext-*.js"],
|
||||||
|
ignores: ["components/extensions/ext-c-*.js"],
|
||||||
module.exports = {
|
languageOptions: {
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ["components/extensions/ext-*.js"],
|
|
||||||
excludedFiles: ["components/extensions/ext-c-*.js"],
|
|
||||||
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,49 +21,49 @@ module.exports = {
|
|||||||
windowTracker: true,
|
windowTracker: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
files: [
|
{
|
||||||
"chrome/geckoview/**",
|
files: [
|
||||||
"components/geckoview/**",
|
"chrome/geckoview/**",
|
||||||
"modules/geckoview/**",
|
"components/geckoview/**",
|
||||||
"actors/**",
|
"modules/geckoview/**",
|
||||||
|
"actors/**",
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
"no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
argsIgnorePattern: "^_",
|
||||||
|
vars: "local",
|
||||||
|
varsIgnorePattern: "(debug|warn)",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
rules: {
|
"no-restricted-syntax": [
|
||||||
"no-unused-vars": [
|
"error",
|
||||||
"error",
|
{
|
||||||
{
|
selector: `CallExpression > \
|
||||||
argsIgnorePattern: "^_",
|
|
||||||
vars: "local",
|
|
||||||
varsIgnorePattern: "(debug|warn)",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"no-restricted-syntax": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
selector: `CallExpression > \
|
|
||||||
Identifier.callee[name = /^debug$|^warn$/]`,
|
Identifier.callee[name = /^debug$|^warn$/]`,
|
||||||
message:
|
message:
|
||||||
"Use debug and warn with template literals, e.g. debug `foo`;",
|
"Use debug and warn with template literals, e.g. debug `foo`;",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
selector: `BinaryExpression[operator = '+'] > \
|
selector: `BinaryExpression[operator = '+'] > \
|
||||||
TaggedTemplateExpression.left > \
|
TaggedTemplateExpression.left > \
|
||||||
Identifier.tag[name = /^debug$|^warn$/]`,
|
Identifier.tag[name = /^debug$|^warn$/]`,
|
||||||
message:
|
message:
|
||||||
"Use only one template literal with debug/warn instead of concatenating multiple expressions,\n" +
|
"Use only one template literal with debug/warn instead of concatenating multiple expressions,\n" +
|
||||||
" e.g. (debug `foo ${42} bar`) instead of (debug `foo` + 42 + `bar`)",
|
" e.g. (debug `foo ${42} bar`) instead of (debug `foo` + 42 + `bar`)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
selector: `TaggedTemplateExpression[tag.type = 'Identifier'][tag.name = /^debug$|^warn$/] > \
|
selector: `TaggedTemplateExpression[tag.type = 'Identifier'][tag.name = /^debug$|^warn$/] > \
|
||||||
TemplateLiteral.quasi CallExpression > \
|
TemplateLiteral.quasi CallExpression > \
|
||||||
MemberExpression.callee[object.type = 'Identifier'][object.name = 'JSON'] > \
|
MemberExpression.callee[object.type = 'Identifier'][object.name = 'JSON'] > \
|
||||||
Identifier.property[name = 'stringify']`,
|
Identifier.property[name = 'stringify']`,
|
||||||
message:
|
message:
|
||||||
"Don't call JSON.stringify within debug/warn literals,\n" +
|
"Don't call JSON.stringify within debug/warn literals,\n" +
|
||||||
" e.g. (debug `foo=${foo}`) instead of (debug `foo=${JSON.stringify(foo)}`)",
|
" e.g. (debug `foo=${foo}`) instead of (debug `foo=${JSON.stringify(foo)}`)",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -2,75 +2,79 @@
|
|||||||
* 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 [
|
||||||
rules: {
|
{
|
||||||
// Rules from the mozilla plugin
|
plugins: { mozilla },
|
||||||
"mozilla/balanced-listeners": "error",
|
|
||||||
"mozilla/no-aArgs": "error",
|
|
||||||
"mozilla/var-only-at-top-level": "error",
|
|
||||||
|
|
||||||
"valid-jsdoc": [
|
rules: {
|
||||||
"error",
|
// Rules from the mozilla plugin
|
||||||
{
|
"mozilla/balanced-listeners": "error",
|
||||||
prefer: {
|
"mozilla/no-aArgs": "error",
|
||||||
return: "returns",
|
"mozilla/var-only-at-top-level": "error",
|
||||||
|
|
||||||
|
"valid-jsdoc": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
prefer: {
|
||||||
|
return: "returns",
|
||||||
|
},
|
||||||
|
preferType: {
|
||||||
|
Boolean: "boolean",
|
||||||
|
Number: "number",
|
||||||
|
String: "string",
|
||||||
|
bool: "boolean",
|
||||||
|
},
|
||||||
|
requireParamDescription: false,
|
||||||
|
requireReturn: false,
|
||||||
|
requireReturnDescription: false,
|
||||||
},
|
},
|
||||||
preferType: {
|
],
|
||||||
Boolean: "boolean",
|
|
||||||
Number: "number",
|
|
||||||
String: "string",
|
|
||||||
bool: "boolean",
|
|
||||||
},
|
|
||||||
requireParamDescription: false,
|
|
||||||
requireReturn: false,
|
|
||||||
requireReturnDescription: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
// No expressions where a statement is expected
|
// No expressions where a statement is expected
|
||||||
"no-unused-expressions": "error",
|
"no-unused-expressions": "error",
|
||||||
|
|
||||||
// No declaring variables that are never used
|
// No declaring variables that are never used
|
||||||
"no-unused-vars": "error",
|
"no-unused-vars": "error",
|
||||||
|
|
||||||
// Disallow using variables outside the blocks they are defined (especially
|
// Disallow using variables outside the blocks they are defined (especially
|
||||||
// since only let and const are used, see "no-var").
|
// since only let and const are used, see "no-var").
|
||||||
"block-scoped-var": "error",
|
"block-scoped-var": "error",
|
||||||
|
|
||||||
// Warn about cyclomatic complexity in functions.
|
// Warn about cyclomatic complexity in functions.
|
||||||
complexity: ["error", { max: 26 }],
|
complexity: ["error", { max: 26 }],
|
||||||
|
|
||||||
// Maximum depth callbacks can be nested.
|
// Maximum depth callbacks can be nested.
|
||||||
"max-nested-callbacks": ["error", 4],
|
"max-nested-callbacks": ["error", 4],
|
||||||
|
|
||||||
// Allow the console API aside from console.log.
|
// Allow the console API aside from console.log.
|
||||||
"no-console": ["error", { allow: ["error", "info", "trace", "warn"] }],
|
"no-console": ["error", { allow: ["error", "info", "trace", "warn"] }],
|
||||||
|
|
||||||
// Disallow fallthrough of case statements, except if there is a comment.
|
// Disallow fallthrough of case statements, except if there is a comment.
|
||||||
"no-fallthrough": "error",
|
"no-fallthrough": "error",
|
||||||
|
|
||||||
// Disallow use of multiline strings (use template strings instead).
|
// Disallow use of multiline strings (use template strings instead).
|
||||||
"no-multi-str": "error",
|
"no-multi-str": "error",
|
||||||
|
|
||||||
// Disallow usage of __proto__ property.
|
// Disallow usage of __proto__ property.
|
||||||
"no-proto": "error",
|
"no-proto": "error",
|
||||||
|
|
||||||
// Disallow use of assignment in return statement. It is preferable for a
|
// Disallow use of assignment in return statement. It is preferable for a
|
||||||
// single line of code to have only one easily predictable effect.
|
// single line of code to have only one easily predictable effect.
|
||||||
"no-return-assign": "error",
|
"no-return-assign": "error",
|
||||||
|
|
||||||
// Require use of the second argument for parseInt().
|
// Require use of the second argument for parseInt().
|
||||||
radix: "error",
|
radix: "error",
|
||||||
|
|
||||||
// Require "use strict" to be defined globally in the script.
|
// Require "use strict" to be defined globally in the script.
|
||||||
strict: ["error", "global"],
|
strict: ["error", "global"],
|
||||||
|
|
||||||
// Disallow Yoda conditions (where literal value comes first).
|
// Disallow Yoda conditions (where literal value comes first).
|
||||||
yoda: "error",
|
yoda: "error",
|
||||||
|
|
||||||
// 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,14 +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";
|
export default [
|
||||||
|
{
|
||||||
module.exports = {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
Bookmarks: false,
|
Bookmarks: false,
|
||||||
EnableEngines: false,
|
EnableEngines: false,
|
||||||
Passwords: false,
|
Passwords: false,
|
||||||
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.webextensions,
|
||||||
|
ExtensionAPI: true,
|
||||||
|
// available to frameScripts
|
||||||
|
addMessageListener: false,
|
||||||
|
content: false,
|
||||||
|
sendAsyncMessage: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
globals: {
|
];
|
||||||
ExtensionAPI: true,
|
|
||||||
// available to frameScripts
|
|
||||||
addMessageListener: false,
|
|
||||||
content: false,
|
|
||||||
sendAsyncMessage: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,53 +2,49 @@
|
|||||||
* 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 = {
|
files: [
|
||||||
overrides: [
|
"chrome/geckoview/**",
|
||||||
{
|
"components/geckoview/**",
|
||||||
files: [
|
"modules/geckoview/**",
|
||||||
"chrome/geckoview/**",
|
"actors/**",
|
||||||
"components/geckoview/**",
|
],
|
||||||
"modules/geckoview/**",
|
rules: {
|
||||||
"actors/**",
|
"no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
args: "none",
|
||||||
|
vars: "local",
|
||||||
|
varsIgnorePattern: "(debug|warn)",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
rules: {
|
"no-restricted-syntax": [
|
||||||
"no-unused-vars": [
|
"error",
|
||||||
"error",
|
{
|
||||||
{
|
selector: `CallExpression > \
|
||||||
args: "none",
|
|
||||||
vars: "local",
|
|
||||||
varsIgnorePattern: "(debug|warn)",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"no-restricted-syntax": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
selector: `CallExpression > \
|
|
||||||
Identifier.callee[name = /^debug$|^warn$/]`,
|
Identifier.callee[name = /^debug$|^warn$/]`,
|
||||||
message:
|
message:
|
||||||
"Use debug and warn with template literals, e.g. debug `foo`;",
|
"Use debug and warn with template literals, e.g. debug `foo`;",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
selector: `BinaryExpression[operator = '+'] > \
|
selector: `BinaryExpression[operator = '+'] > \
|
||||||
TaggedTemplateExpression.left > \
|
TaggedTemplateExpression.left > \
|
||||||
Identifier.tag[name = /^debug$|^warn$/]`,
|
Identifier.tag[name = /^debug$|^warn$/]`,
|
||||||
message:
|
message:
|
||||||
"Use only one template literal with debug/warn instead of concatenating multiple expressions,\n" +
|
"Use only one template literal with debug/warn instead of concatenating multiple expressions,\n" +
|
||||||
" e.g. (debug `foo ${42} bar`) instead of (debug `foo` + 42 + `bar`)",
|
" e.g. (debug `foo ${42} bar`) instead of (debug `foo` + 42 + `bar`)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
selector: `TaggedTemplateExpression[tag.type = 'Identifier'][tag.name = /^debug$|^warn$/] > \
|
selector: `TaggedTemplateExpression[tag.type = 'Identifier'][tag.name = /^debug$|^warn$/] > \
|
||||||
TemplateLiteral.quasi CallExpression > \
|
TemplateLiteral.quasi CallExpression > \
|
||||||
MemberExpression.callee[object.type = 'Identifier'][object.name = 'JSON'] > \
|
MemberExpression.callee[object.type = 'Identifier'][object.name = 'JSON'] > \
|
||||||
Identifier.property[name = 'stringify']`,
|
Identifier.property[name = 'stringify']`,
|
||||||
message:
|
message:
|
||||||
"Don't call JSON.stringify within debug/warn literals,\n" +
|
"Don't call JSON.stringify within debug/warn literals,\n" +
|
||||||
" e.g. (debug `foo=${foo}`) instead of (debug `foo=${JSON.stringify(foo)}`)",
|
" e.g. (debug `foo=${foo}`) instead of (debug `foo=${JSON.stringify(foo)}`)",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -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"],
|
ignores: ["ext-c-*.js"],
|
||||||
excludedFiles: ["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"],
|
{
|
||||||
globals: {
|
files: ["ext-c-*.js"],
|
||||||
...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: {
|
{
|
||||||
camelcase: ["error", { properties: "never" }],
|
rules: {
|
||||||
"no-var": "error",
|
camelcase: ["error", { properties: "never" }],
|
||||||
|
"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: {
|
{
|
||||||
camelcase: "off",
|
rules: {
|
||||||
|
camelcase: "off",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -2,45 +2,45 @@
|
|||||||
* 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 [
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
// Enforce return statements in callbacks of array methods.
|
||||||
|
"array-callback-return": "error",
|
||||||
|
|
||||||
module.exports = {
|
// Require default case in switch statements.
|
||||||
rules: {
|
"default-case": "error",
|
||||||
// Enforce return statements in callbacks of array methods.
|
|
||||||
"array-callback-return": "error",
|
|
||||||
|
|
||||||
// Require default case in switch statements.
|
// Disallow use of alert(), confirm(), and prompt().
|
||||||
"default-case": "error",
|
"no-alert": "error",
|
||||||
|
|
||||||
// Disallow use of alert(), confirm(), and prompt().
|
// Disallow likely erroneous `switch` scoped lexical declarations in
|
||||||
"no-alert": "error",
|
// case/default clauses.
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
|
||||||
// Disallow likely erroneous `switch` scoped lexical declarations in
|
// Disallow constant expressions in conditions (except for loops).
|
||||||
// case/default clauses.
|
"no-constant-condition": ["error", { checkLoops: false }],
|
||||||
"no-case-declarations": "error",
|
|
||||||
|
|
||||||
// Disallow constant expressions in conditions (except for loops).
|
// Disallow extending of native objects.
|
||||||
"no-constant-condition": ["error", { checkLoops: false }],
|
"no-extend-native": "error",
|
||||||
|
|
||||||
// Disallow extending of native objects.
|
// Disallow use of assignment in return statement.
|
||||||
"no-extend-native": "error",
|
"no-return-assign": ["error", "always"],
|
||||||
|
|
||||||
// Disallow use of assignment in return statement.
|
// Disallow template literal placeholder syntax in regular strings.
|
||||||
"no-return-assign": ["error", "always"],
|
"no-template-curly-in-string": "error",
|
||||||
|
|
||||||
// Disallow template literal placeholder syntax in regular strings.
|
// Disallow unmodified loop conditions.
|
||||||
"no-template-curly-in-string": "error",
|
"no-unmodified-loop-condition": "error",
|
||||||
|
|
||||||
// Disallow unmodified loop conditions.
|
// No expressions where a statement is expected
|
||||||
"no-unmodified-loop-condition": "error",
|
"no-unused-expressions": "error",
|
||||||
|
|
||||||
// No expressions where a statement is expected
|
// Require "use strict" to be defined globally in the script.
|
||||||
"no-unused-expressions": "error",
|
strict: ["error", "global"],
|
||||||
|
|
||||||
// Require "use strict" to be defined globally in the script.
|
// Disallow Yoda conditions.
|
||||||
strict: ["error", "global"],
|
yoda: ["error", "never"],
|
||||||
|
},
|
||||||
// Disallow Yoda conditions.
|
|
||||||
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: {
|
{
|
||||||
// Disallow non-top level |var| declarations.
|
rules: {
|
||||||
"mozilla/var-only-at-top-level": "error",
|
// Disallow non-top level |var| declarations.
|
||||||
|
"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,28 +1,34 @@
|
|||||||
"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: {
|
{
|
||||||
// Injected into tests via tps.sys.mjs
|
languageOptions: {
|
||||||
Addons: false,
|
globals: {
|
||||||
Addresses: false,
|
// Injected into tests via tps.sys.mjs
|
||||||
Bookmarks: false,
|
Addons: false,
|
||||||
CreditCards: false,
|
Addresses: false,
|
||||||
EnableEngines: false,
|
Bookmarks: false,
|
||||||
EnsureTracking: false,
|
CreditCards: false,
|
||||||
ExtStorage: false,
|
EnableEngines: false,
|
||||||
Formdata: false,
|
EnsureTracking: false,
|
||||||
History: false,
|
ExtStorage: false,
|
||||||
Login: false,
|
Formdata: false,
|
||||||
Passwords: false,
|
History: false,
|
||||||
Phase: false,
|
Login: false,
|
||||||
Prefs: false,
|
Passwords: false,
|
||||||
STATE_DISABLED: false,
|
Phase: false,
|
||||||
STATE_ENABLED: false,
|
Prefs: false,
|
||||||
Sync: false,
|
STATE_DISABLED: false,
|
||||||
SYNC_WIPE_CLIENT: false,
|
STATE_ENABLED: false,
|
||||||
SYNC_WIPE_REMOTE: false,
|
Sync: false,
|
||||||
Tabs: false,
|
SYNC_WIPE_CLIENT: false,
|
||||||
Windows: false,
|
SYNC_WIPE_REMOTE: false,
|
||||||
WipeServer: false,
|
Tabs: false,
|
||||||
|
Windows: 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,50 +2,52 @@
|
|||||||
* 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 [
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
// JS files in this folder are commonly xpcshell scripts where |arguments|
|
||||||
|
// is defined in the global scope.
|
||||||
|
arguments: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
// Enforce return statements in callbacks of array methods.
|
||||||
|
"array-callback-return": "error",
|
||||||
|
|
||||||
module.exports = {
|
// Require default case in switch statements.
|
||||||
globals: {
|
"default-case": "error",
|
||||||
// JS files in this folder are commonly xpcshell scripts where |arguments|
|
|
||||||
// is defined in the global scope.
|
// Disallow use of alert(), confirm(), and prompt().
|
||||||
arguments: false,
|
"no-alert": "error",
|
||||||
|
|
||||||
|
// Disallow likely erroneous `switch` scoped lexical declarations in
|
||||||
|
// case/default clauses.
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
|
||||||
|
// Disallow constant expressions in conditions (except for loops).
|
||||||
|
"no-constant-condition": ["error", { checkLoops: false }],
|
||||||
|
|
||||||
|
// Disallow extending of native objects.
|
||||||
|
"no-extend-native": "error",
|
||||||
|
|
||||||
|
// Disallow use of assignment in return statement.
|
||||||
|
"no-return-assign": ["error", "always"],
|
||||||
|
|
||||||
|
// Disallow template literal placeholder syntax in regular strings.
|
||||||
|
"no-template-curly-in-string": "error",
|
||||||
|
|
||||||
|
// Disallow unmodified loop conditions.
|
||||||
|
"no-unmodified-loop-condition": "error",
|
||||||
|
|
||||||
|
// No expressions where a statement is expected
|
||||||
|
"no-unused-expressions": "error",
|
||||||
|
|
||||||
|
// Require "use strict" to be defined globally in the script.
|
||||||
|
strict: ["error", "global"],
|
||||||
|
|
||||||
|
// Disallow Yoda conditions.
|
||||||
|
yoda: ["error", "never"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
];
|
||||||
// Enforce return statements in callbacks of array methods.
|
|
||||||
"array-callback-return": "error",
|
|
||||||
|
|
||||||
// Require default case in switch statements.
|
|
||||||
"default-case": "error",
|
|
||||||
|
|
||||||
// Disallow use of alert(), confirm(), and prompt().
|
|
||||||
"no-alert": "error",
|
|
||||||
|
|
||||||
// Disallow likely erroneous `switch` scoped lexical declarations in
|
|
||||||
// case/default clauses.
|
|
||||||
"no-case-declarations": "error",
|
|
||||||
|
|
||||||
// Disallow constant expressions in conditions (except for loops).
|
|
||||||
"no-constant-condition": ["error", { checkLoops: false }],
|
|
||||||
|
|
||||||
// Disallow extending of native objects.
|
|
||||||
"no-extend-native": "error",
|
|
||||||
|
|
||||||
// Disallow use of assignment in return statement.
|
|
||||||
"no-return-assign": ["error", "always"],
|
|
||||||
|
|
||||||
// Disallow template literal placeholder syntax in regular strings.
|
|
||||||
"no-template-curly-in-string": "error",
|
|
||||||
|
|
||||||
// Disallow unmodified loop conditions.
|
|
||||||
"no-unmodified-loop-condition": "error",
|
|
||||||
|
|
||||||
// No expressions where a statement is expected
|
|
||||||
"no-unused-expressions": "error",
|
|
||||||
|
|
||||||
// Require "use strict" to be defined globally in the script.
|
|
||||||
strict: ["error", "global"],
|
|
||||||
|
|
||||||
// Disallow Yoda conditions.
|
|
||||||
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 [
|
||||||
globals: {
|
{
|
||||||
user_pref: true,
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
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 = {
|
export default [
|
||||||
env: {
|
{
|
||||||
webextensions: true,
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.webextensions,
|
||||||
|
getTestConfig: false,
|
||||||
|
startMark: true,
|
||||||
|
endMark: true,
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: { mozilla },
|
||||||
|
rules: {
|
||||||
|
"mozilla/avoid-Date-timing": "error",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
];
|
||||||
globals: {
|
|
||||||
getTestConfig: false,
|
|
||||||
startMark: true,
|
|
||||||
endMark: true,
|
|
||||||
name: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
plugins: ["mozilla"],
|
|
||||||
|
|
||||||
rules: {
|
|
||||||
"mozilla/avoid-Date-timing": "error",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -2,35 +2,38 @@
|
|||||||
* 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 [
|
||||||
globals: {
|
{
|
||||||
Cc: false,
|
languageOptions: {
|
||||||
Ci: false,
|
globals: {
|
||||||
Cu: false,
|
Cc: false,
|
||||||
content: true,
|
Ci: false,
|
||||||
dumpLog: false,
|
Cu: false,
|
||||||
netscape: false,
|
content: true,
|
||||||
addMessageListener: false,
|
dumpLog: false,
|
||||||
goQuitApplication: false,
|
netscape: false,
|
||||||
MozillaFileLogger: false,
|
addMessageListener: false,
|
||||||
Profiler: true,
|
goQuitApplication: false,
|
||||||
Services: false,
|
MozillaFileLogger: false,
|
||||||
gBrowser: false,
|
Profiler: true,
|
||||||
removeMessageListener: false,
|
Services: false,
|
||||||
sendAsyncMessage: false,
|
gBrowser: false,
|
||||||
sendSyncMessage: false,
|
removeMessageListener: false,
|
||||||
TalosPowersContent: true,
|
sendAsyncMessage: false,
|
||||||
TalosPowersParent: true,
|
sendSyncMessage: false,
|
||||||
TalosContentProfiler: true,
|
TalosPowersContent: true,
|
||||||
TalosParentProfiler: true,
|
TalosPowersParent: true,
|
||||||
tpRecordTime: true,
|
TalosContentProfiler: true,
|
||||||
|
TalosParentProfiler: true,
|
||||||
|
tpRecordTime: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: { mozilla },
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
"mozilla/avoid-Date-timing": "error",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
];
|
||||||
plugins: ["mozilla"],
|
|
||||||
|
|
||||||
rules: {
|
|
||||||
"mozilla/avoid-Date-timing": "error",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,26 +1,34 @@
|
|||||||
"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"],
|
|
||||||
globals: {
|
|
||||||
exports: true,
|
|
||||||
isWorker: true,
|
|
||||||
loader: true,
|
|
||||||
module: true,
|
|
||||||
reportError: true,
|
|
||||||
require: true,
|
|
||||||
dampWindow: true,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
"no-unused-vars": ["error", { argsIgnorePattern: "^_", vars: "all" }],
|
|
||||||
// These are the rules that have been configured so far to match the
|
|
||||||
// devtools coding style.
|
|
||||||
|
|
||||||
// Rules from the mozilla plugin
|
export default [
|
||||||
"mozilla/no-aArgs": "error",
|
{
|
||||||
"mozilla/no-define-cc-etc": "off",
|
plugins: { mozilla },
|
||||||
// See bug 1224289.
|
languageOptions: {
|
||||||
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
globals: {
|
||||||
"mozilla/var-only-at-top-level": "error",
|
exports: true,
|
||||||
|
isWorker: true,
|
||||||
|
loader: true,
|
||||||
|
module: true,
|
||||||
|
reportError: true,
|
||||||
|
require: true,
|
||||||
|
dampWindow: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"no-unused-vars": ["error", { argsIgnorePattern: "^_", vars: "all" }],
|
||||||
|
// These are the rules that have been configured so far to match the
|
||||||
|
// devtools coding style.
|
||||||
|
|
||||||
|
// Rules from the mozilla plugin
|
||||||
|
"mozilla/no-aArgs": "error",
|
||||||
|
"mozilla/no-define-cc-etc": "off",
|
||||||
|
// See bug 1224289.
|
||||||
|
"mozilla/reject-importGlobalProperties": ["error", "everything"],
|
||||||
|
"mozilla/var-only-at-top-level": "error",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
];
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
{
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
"rules": {
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
"no-undef": "off"
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
}
|
|
||||||
}
|
export default [
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
"no-undef": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
{
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
"rules": {
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
"no-undef": "off"
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
}
|
|
||||||
}
|
export default [
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
"no-undef": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -2,29 +2,38 @@
|
|||||||
* 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: {
|
parserOptions: {
|
||||||
browser: false,
|
// This should match with the minimum node version that the ESLint CI
|
||||||
node: true,
|
// process uses (check the linux64-node toolchain).
|
||||||
},
|
ecmaVersion: 12,
|
||||||
parser: "espree",
|
},
|
||||||
parserOptions: {
|
},
|
||||||
// This should match with the minimum node version that the ESLint CI
|
|
||||||
// process uses (check the linux64-node toolchain).
|
|
||||||
ecmaVersion: 12,
|
|
||||||
},
|
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
camelcase: ["error", { properties: "never" }],
|
camelcase: ["error", { properties: "never" }],
|
||||||
"handle-callback-err": ["error", "er"],
|
"handle-callback-err": ["error", "er"],
|
||||||
"no-undef-init": "error",
|
"no-undef-init": "error",
|
||||||
"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: {
|
{
|
||||||
// Require object keys to be sorted.
|
rules: {
|
||||||
"sort-keys": "error",
|
// Require object keys to be sorted.
|
||||||
|
"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.jquery,
|
||||||
|
apply: true,
|
||||||
|
applyChunks: true,
|
||||||
|
tasks: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
globals: {
|
];
|
||||||
apply: true,
|
|
||||||
applyChunks: 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: {
|
||||||
|
"no-console": "off",
|
||||||
|
strict: ["error", "global"],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
];
|
||||||
"no-console": "off",
|
|
||||||
strict: ["error", "global"],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user