diff options
Diffstat (limited to 'tools/lint')
27 files changed, 412 insertions, 172 deletions
diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js index c4d28594b5..036ed1bda3 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -55,6 +55,7 @@ module.exports = { files: ["**/*.sys.mjs", "**/*.jsm"], rules: { "mozilla/lazy-getter-object-name": "error", + "mozilla/reject-chromeutils-import": "error", "mozilla/reject-eager-module-in-lazy-getter": "error", "mozilla/reject-global-this": "error", "mozilla/reject-globalThis-modification": "error", @@ -76,7 +77,7 @@ module.exports = { "no-unused-vars": [ "error", { - args: "none", + argsIgnorePattern: "^_", vars: "all", }, ], @@ -142,7 +143,7 @@ module.exports = { }, // When adding items to this file please check for effects on sub-directories. - plugins: ["fetch-options", "html", "json", "no-unsanitized"], + plugins: ["html", "json", "no-unsanitized"], // When adding items to this file please check for effects on all of toolkit // and browser @@ -163,10 +164,6 @@ module.exports = { // Encourage the use of dot notation whenever possible. "dot-notation": "error", - // XXX This rule should be enabled, see Bug 1557040 - // No credentials submitted with fetch calls - "fetch-options/no-fetch-credentials": "off", - // Maximum depth callbacks can be nested. "max-nested-callbacks": ["error", 10], @@ -317,7 +314,7 @@ module.exports = { "no-unused-vars": [ "error", { - args: "none", + argsIgnorePattern: "^_", vars: "local", }, ], diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js index d3c983999a..7701a0b2ca 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js @@ -29,7 +29,7 @@ module.exports = { "no-unused-vars": [ "error", { - args: "none", + argsIgnorePattern: "^_", vars: "local", }, ], @@ -42,7 +42,7 @@ module.exports = { "no-unused-vars": [ "error", { - args: "none", + argsIgnorePattern: "^_", vars: "all", }, ], diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js index 241299e2d3..83fa01935e 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js @@ -57,6 +57,7 @@ const MAPPINGS = { "browser/components/places/content/places-menupopup.js", "shopping-sidebar.js": "browser/components/shopping/content/shopping-sidebar.js", + "browser-sidebar.js": "browser/components/sidebar/browser-sidebar.js", }; const globalScriptsRegExp = diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js index bbc1f9bed8..4d894b58cf 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js @@ -634,8 +634,8 @@ module.exports = { let globalScope; let parser = { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = helpers.getScope(context, node); }, }; let filename = context.getFilename(); @@ -651,10 +651,14 @@ module.exports = { for (let type of Object.keys(GlobalsForNode.prototype)) { parser[type] = function (node) { if (type === "Program") { - globalScope = context.getScope(); + globalScope = helpers.getScope(context, node); helpers.addGlobals(extraHTMLGlobals, globalScope); } - let globals = handler[type](node, context.getAncestors(), globalScope); + let globals = handler[type]( + node, + helpers.getAncestors(context, node), + globalScope + ); helpers.addGlobals( globals, globalScope, diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js index 9ab51df37e..7d44b4b1b3 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js @@ -794,4 +794,38 @@ module.exports = { } return null; }, + + /** + * Gets the scope for a node taking account of where the scope function + * is available (supports node versions earlier than 8.37.0). + * + * @param {object} context + * The context passed from ESLint. + * @param {object} node + * The node to get the scope for. + * returns {function} + * The getScope function object. + */ + getScope(context, node) { + return context.sourceCode?.getScope + ? context.sourceCode.getScope(node) + : context.getScope(); + }, + + /** + * Gets the ancestors for a node taking account of where the ancestors function + * is available (supports node versions earlier than 8.38.0). + * + * @param {object} context + * The context passed from ESLint. + * @param {object} node + * The node to get the scope for. + * returns {function} + * The getScope function object. + */ + getAncestors(context, node) { + return context.sourceCode?.getAncestors + ? context.sourceCode.getAncestors(node) + : context.getAncestors(); + }, }; diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/mark-exported-symbols-as-used.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/mark-exported-symbols-as-used.js index 3664374053..b632e3b632 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/mark-exported-symbols-as-used.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/mark-exported-symbols-as-used.js @@ -19,16 +19,26 @@ function markArrayElementsAsUsed(context, node, expression) { } for (let element of expression.elements) { - context.markVariableAsUsed(element.value); + context.markVariableAsUsed + ? context.markVariableAsUsed(element.value) + : context.sourceCode.markVariableAsUsed(element.value); } // Also mark EXPORTED_SYMBOLS as used. - context.markVariableAsUsed("EXPORTED_SYMBOLS"); + context.markVariableAsUsed + ? context.markVariableAsUsed("EXPORTED_SYMBOLS") + : context.sourceCode.markVariableAsUsed("EXPORTED_SYMBOLS"); } // Ignore assignments not in the global scope, e.g. where special module // definitions are required due to having different ways of importing files, // e.g. osfile. -function isGlobalScope(context) { +function isGlobalScope(context, node) { + if (context.sourceCode?.getScope) { + let upper = context.sourceCode.getScope(node).upper; + // ESLint v9 uses a global scope object with type = "global". Earlier + // versions use a null upper scope. + return !upper || upper.type == "global"; + } return !context.getScope().upper; } @@ -55,14 +65,14 @@ module.exports = { node.left.type === "MemberExpression" && node.left.object.type === "ThisExpression" && node.left.property.name === "EXPORTED_SYMBOLS" && - isGlobalScope(context) + isGlobalScope(context, node) ) { markArrayElementsAsUsed(context, node, node.right); } }, VariableDeclaration(node) { - if (!isGlobalScope(context)) { + if (!isGlobalScope(context, node)) { return; } diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-global-this.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-global-this.js index ec4b5fd43d..1067a4befa 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-global-this.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-global-this.js @@ -29,7 +29,7 @@ module.exports = { create(context) { return { ThisExpression(node) { - if (!helpers.getIsGlobalThis(context.getAncestors())) { + if (!helpers.getIsGlobalThis(helpers.getAncestors(context, node))) { return; } diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-mixing-eager-and-lazy.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-mixing-eager-and-lazy.js index 5779a90afd..41ddc998a3 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-mixing-eager-and-lazy.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-mixing-eager-and-lazy.js @@ -71,7 +71,7 @@ module.exports = { (callerSource === "ChromeUtils.import" || callerSource === "ChromeUtils.importESModule") && helpers.getIsTopLevelAndUnconditionallyExecuted( - context.getAncestors() + helpers.getAncestors(context, node) ) ) { if (node.arguments.length < 1) { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-multiple-getters-calls.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-multiple-getters-calls.js index e6e37ad035..0e0f6e2e17 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-multiple-getters-calls.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-multiple-getters-calls.js @@ -56,6 +56,24 @@ module.exports = { return; } + if (node.arguments.length >= 3) { + const options = node.arguments[2]; + let globalOption = null; + if (options.type == "ObjectExpression") { + for (const prop of options.properties) { + if ( + prop.type == "Property" && + isIdentifier(prop.key, "global") + ) { + globalOption = helpers.getASTSource(prop.value); + } + } + } + if (globalOption) { + target += "+" + globalOption; + } + } + const parent = stmt.parent; let targets; if (parentToTargets.has(parent)) { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-top-level-await.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-top-level-await.js index dff7db0f9a..7356fe10bf 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-top-level-await.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-top-level-await.js @@ -26,7 +26,7 @@ module.exports = { create(context) { return { AwaitExpression(node) { - if (!helpers.getIsTopLevelScript(context.getAncestors())) { + if (!helpers.getIsTopLevelScript(helpers.getAncestors(context, node))) { return; } context.report({ node, messageId: "rejectTopLevelAwait" }); @@ -34,7 +34,7 @@ module.exports = { ForOfStatement(node) { if ( !node.await || - !helpers.getIsTopLevelScript(context.getAncestors()) + !helpers.getIsTopLevelScript(helpers.getAncestors(context, node)) ) { return; } diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-isInstance.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-isInstance.js index ffd9bc9566..f6d6f5e5d3 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-isInstance.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-isInstance.js @@ -11,6 +11,7 @@ const fs = require("fs"); const { maybeGetMemberPropertyName } = require("../helpers"); +const helpers = require("../helpers"); const privilegedGlobals = Object.keys( require("../environments/privileged.js").globals @@ -133,7 +134,7 @@ module.exports = { const { operator, right } = node; if ( operator === "instanceof" && - pointsToDOMInterface(context.getScope(), right) + pointsToDOMInterface(helpers.getScope(context, node), right) ) { context.report({ node, diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-static-import.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-static-import.js index 100b5682de..0a768e25d4 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-static-import.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-static-import.js @@ -35,7 +35,7 @@ module.exports = { node.init?.type != "CallExpression" || node.init?.callee?.type != "MemberExpression" || !context.getFilename().endsWith(".sys.mjs") || - !helpers.isTopLevel(context.getAncestors()) + !helpers.isTopLevel(helpers.getAncestors(context, node)) ) { return; } diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/valid-lazy.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/valid-lazy.js index 048ed17e3e..2be8840bf7 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/valid-lazy.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/valid-lazy.js @@ -225,7 +225,7 @@ module.exports = { } if ( helpers.getIsTopLevelAndUnconditionallyExecuted( - context.getAncestors() + helpers.getAncestors(context, node) ) ) { context.report({ diff --git a/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt b/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt index c33cc36e38..a804c1392a 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt +++ b/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt @@ -1,9 +1,9 @@ [ { "filename": "eslint-plugin-mozilla.tar.gz", - "size": 5593447, + "size": 5695135, "algorithm": "sha512", - "digest": "ba1f9719d64200e0488003d76f75a189bf4103aa7e653b0aaa0b1053543c5349e3d272eaac006b98f1a3a6530cc0fcfd3aaedc62ce1df6050f737c4865f49d69", + "digest": "84122ccc750528b67632207208c6f53b0bafee52d1ef1ce42a07319008cb49edabaada0931058aafa1c6af66ed49b3a120d9bd40e4b120e4e4cb63ec6cc40e6b", "unpack": true, "visibility": "public" } diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json index c4c36118d2..1b4f8f9b48 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json @@ -1,12 +1,12 @@ { "name": "eslint-plugin-mozilla", - "version": "3.7.1", + "version": "3.7.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eslint-plugin-mozilla", - "version": "3.7.1", + "version": "3.7.3", "license": "MPL-2.0", "dependencies": { "eslint-scope": "^7.2.2", @@ -27,7 +27,6 @@ "@microsoft/eslint-plugin-sdl": "^0.2.2", "eslint": "^7.23.0 || ^8.0.0", "eslint-config-prettier": "^8.0.0 || ^9.0.0", - "eslint-plugin-fetch-options": "^0.0.5", "eslint-plugin-html": "^7.0.0 || ^8.0.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-no-unsanitized": "^4.0.0" @@ -119,9 +118,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==" }, "node_modules/@microsoft/eslint-plugin-sdl": { "version": "0.2.2", @@ -277,15 +276,16 @@ } }, "node_modules/array-includes": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", - "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -387,12 +387,15 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/brace-expansion": { @@ -560,6 +563,57 @@ "node": ">= 8" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "peer": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "peer": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -716,17 +770,21 @@ } }, "node_modules/es-abstract": { - "version": "1.22.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", - "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", "es-define-property": "^1.0.0", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", @@ -737,10 +795,11 @@ "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.1", + "hasown": "^2.0.2", "internal-slot": "^1.0.7", "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.3", @@ -751,17 +810,17 @@ "object-keys": "^1.1.1", "object.assign": "^4.1.5", "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", + "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.2", "typed-array-byte-length": "^1.0.1", "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.5", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -791,6 +850,18 @@ "node": ">= 0.4" } }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", @@ -936,15 +1007,6 @@ "eslint": ">=4.19.1" } }, - "node_modules/eslint-plugin-fetch-options": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-fetch-options/-/eslint-plugin-fetch-options-0.0.5.tgz", - "integrity": "sha512-ZMxrccsOAZ7uMQ4nMvPJLqLg6oyLF96YOEwTKWAIbDHpwWUp1raXALZom8ikKucaEnhqWSRuBWI8jBXveFwkJg==", - "peer": true, - "engines": { - "node": ">=0.9.0" - } - }, "node_modules/eslint-plugin-html": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-8.0.0.tgz", @@ -1512,9 +1574,9 @@ } }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "peer": true, "dependencies": { "function-bind": "^1.1.2" @@ -1689,6 +1751,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "peer": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -2192,28 +2269,29 @@ } }, "node_modules/object.entries": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", - "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", - "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2223,27 +2301,31 @@ } }, "node_modules/object.hasown": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", - "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.4.tgz", + "integrity": "sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==", "peer": true, "dependencies": { - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.values": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", - "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2558,13 +2640,13 @@ } }, "node_modules/safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "peer": true, "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -2640,17 +2722,17 @@ } }, "node_modules/set-function-length": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", - "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "peer": true, "dependencies": { - "define-data-property": "^1.1.2", + "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.3", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2723,34 +2805,41 @@ } }, "node_modules/string.prototype.matchall": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", - "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "regexp.prototype.flags": "^1.5.0", - "set-function-name": "^2.0.0", - "side-channel": "^1.0.4" + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -2760,28 +2849,31 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "peer": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2939,9 +3031,9 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "peer": true, "dependencies": { "call-bind": "^1.0.7", @@ -3049,16 +3141,16 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "peer": true, "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index 5d54e8b387..7384f41401 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "3.7.1", + "version": "3.7.3", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint", @@ -35,7 +35,6 @@ "@microsoft/eslint-plugin-sdl": "^0.2.2", "eslint": "^7.23.0 || ^8.0.0", "eslint-config-prettier": "^8.0.0 || ^9.0.0", - "eslint-plugin-fetch-options": "^0.0.5", "eslint-plugin-html": "^7.0.0 || ^8.0.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-no-unsanitized": "^4.0.0" diff --git a/tools/lint/eslint/eslint-plugin-mozilla/tests/reject-multiple-getters-calls.js b/tools/lint/eslint/eslint-plugin-mozilla/tests/reject-multiple-getters-calls.js index a2b88a8652..d9450ad24e 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/tests/reject-multiple-getters-calls.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/tests/reject-multiple-getters-calls.js @@ -46,6 +46,14 @@ ruleTester.run("reject-multiple-getters-calls", rule, { }); } `, + ` + ChromeUtils.defineESModuleGetters(lazy, { + AppConstants: "resource://gre/modules/AppConstants.sys.mjs", + }, { global: "current" }); + ChromeUtils.defineESModuleGetters(lazy, { + PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", + }, { global: "shared" }); + `, ], invalid: [ invalidCode(` @@ -56,5 +64,13 @@ ruleTester.run("reject-multiple-getters-calls", rule, { PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", }); `), + invalidCode(` + ChromeUtils.defineESModuleGetters(lazy, { + AppConstants: "resource://gre/modules/AppConstants.sys.mjs", + }, { global: "current" }); + ChromeUtils.defineESModuleGetters(lazy, { + PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs", + }, { global: "current" }); + `), ], }); diff --git a/tools/lint/eslint/eslint-plugin-spidermonkey-js/lib/environments/self-hosted.js b/tools/lint/eslint/eslint-plugin-spidermonkey-js/lib/environments/self-hosted.js index 37ae42bfa3..bf7069510c 100644 --- a/tools/lint/eslint/eslint-plugin-spidermonkey-js/lib/environments/self-hosted.js +++ b/tools/lint/eslint/eslint-plugin-spidermonkey-js/lib/environments/self-hosted.js @@ -149,7 +149,8 @@ function selfHostingFunctions() { let content = tryReadFile("js/src/vm/SelfHosting.cpp").replace(/\s+/g, ""); let globals = Object.create(null); - for (let m of content.matchAll(/(?:JS_FN|JS_INLINABLE_FN)\("(\w+)"/g)) { + let re = /(?:JS_FN|JS_INLINABLE_FN|JS_TRAMPOLINE_FN)\("(\w+)"/g; + for (let m of content.matchAll(re)) { globals[m[1]] = "readonly"; } return globals; diff --git a/tools/lint/eslint/manifest.tt b/tools/lint/eslint/manifest.tt index bee00211ab..540b2da8e8 100644 --- a/tools/lint/eslint/manifest.tt +++ b/tools/lint/eslint/manifest.tt @@ -1,9 +1,9 @@ [ { "filename": "eslint.tar.gz", - "size": 22159369, + "size": 22290302, "algorithm": "sha512", - "digest": "683b12e0c7463c4e5ba0ec47d680744d7eb870438822963557526d490c36a6a7929d9d0471fbac9dd6f549953285ac734f25a9e0cb1b3651c38350e5582cce5e", + "digest": "e1db81761e5eb2761af1d8117b1b336ad1979ccc0cfcaca0b72a4772aee9e9b98b532c71b4e125fbef574b75100b8e9102465638fbd90996784c2d4e5b90b98c", "unpack": true, "visibility": "public" } diff --git a/tools/lint/file-whitespace.yml b/tools/lint/file-whitespace.yml index 91a8ed2103..748c1a329b 100644 --- a/tools/lint/file-whitespace.yml +++ b/tools/lint/file-whitespace.yml @@ -146,6 +146,7 @@ file-whitespace: - python/mozperftest/perfdocs/running.rst - python/mozperftest/perfdocs/vision.rst - python/mozperftest/perfdocs/writing.rst + extensions: - .c - .cc diff --git a/tools/lint/license.yml b/tools/lint/license.yml index c1cf7e628e..34e1eb817c 100644 --- a/tools/lint/license.yml +++ b/tools/lint/license.yml @@ -30,6 +30,9 @@ license: - gradle.properties # might not work with license - gradle/wrapper/gradle-wrapper.properties + - mobile/android/android-components/gradle/wrapper/gradle-wrapper.properties + - mobile/android/fenix/gradle/wrapper/gradle-wrapper.properties + - mobile/android/focus-android/gradle/wrapper/gradle-wrapper.properties # ICU4X data - intl/icu_segmenter_data # Imported code that is dual Apache2 / MIT licensed @@ -41,6 +44,48 @@ license: - mobile/android/geckoview_example/src/main - testing/webcompat/interventions/ - testing/webcompat/shims/ + # TODO - Bug 1881094: temporarily ignored for firefox-android migration + - mobile/android/android-components/components/browser/engine-system/src/main/res/ + - mobile/android/android-components/components/browser/errorpages/src/main/res/ + - mobile/android/android-components/components/browser/menu/src/main/res/ + - mobile/android/android-components/components/browser/menu2/src/main/res/ + - mobile/android/android-components/components/browser/toolbar/src/main/res/ + - mobile/android/android-components/components/compose/awesomebar/src/main/res/ + - mobile/android/android-components/components/compose/browser-toolbar/src/main/res/ + - mobile/android/android-components/components/compose/cfr/src/main/res/ + - mobile/android/android-components/components/compose/tabstray/src/main/res/ + - mobile/android/android-components/components/feature/addons/src/main/res/ + - mobile/android/android-components/components/feature/app-links/src/main/res/ + - mobile/android/android-components/components/feature/autofill/src/main/res/ + - mobile/android/android-components/components/feature/awesomebar/src/main/res/ + - mobile/android/android-components/components/feature/contextmenu/src/main/res/ + - mobile/android/android-components/components/feature/customtabs/src/main/res/ + - mobile/android/android-components/components/feature/downloads/src/main/res/ + - mobile/android/android-components/components/feature/findinpage/src/main/res/ + - mobile/android/android-components/components/feature/fxsuggest/src/main/res/ + - mobile/android/android-components/components/feature/media/src/main/res/ + - mobile/android/android-components/components/feature/privatemode/src/main/res/ + - mobile/android/android-components/components/feature/prompts/src/main/res/ + - mobile/android/android-components/components/feature/pwa/src/main/res/ + - mobile/android/android-components/components/feature/qr/src/main/res/ + - mobile/android/android-components/components/feature/readerview/src/main/res/ + - mobile/android/android-components/components/feature/search/src/main/res/ + - mobile/android/android-components/components/feature/sitepermissions/ + - mobile/android/android-components/components/feature/tabs/src/main/res/ + - mobile/android/android-components/components/feature/webcompat/src/main/assets/extensions/webcompat/injections/ + - mobile/android/android-components/components/feature/webnotifications/src/main/res/ + - mobile/android/android-components/components/lib/crash/src/main/res/ + - mobile/android/android-components/components/service/nimbus/src/main/res/ + - mobile/android/android-components/components/support/base/src/main/res/ + - mobile/android/android-components/components/support/ktx/src/main/res/ + - mobile/android/android-components/components/support/utils/src/main/res/ + - mobile/android/android-components/components/ui/tabcounter/src/main/res/ + - mobile/android/android-components/components/ui/widgets/src/main/res/ + - mobile/android/android-components/docs/ + - mobile/android/fenix/app/src/main/res/ + - mobile/android/fenix/benchmark/src/main/AndroidManifest.xml + - mobile/android/focus-android/app/lint-baseline.xml + - mobile/android/focus-android/app/src/main/res/ # might not work with license - mobile/android/gradle/dotgradle-offline/gradle.properties # might not work with license @@ -51,8 +96,6 @@ license: - python/mozlint/test/files/ # By design - python/mozrelease/mozrelease - - security/mac/hardenedruntime/v1/production/browser.xml - - security/mac/hardenedruntime/v1/developer/browser.xml - security/mac/hardenedruntime/v2/developer/browser.xml - security/mac/hardenedruntime/v2/developer/media-plugin-helper.xml - security/mac/hardenedruntime/v2/developer/plugin-container.xml diff --git a/tools/lint/perfdocs/framework_gatherers.py b/tools/lint/perfdocs/framework_gatherers.py index 75a6371731..3c0a4026d9 100644 --- a/tools/lint/perfdocs/framework_gatherers.py +++ b/tools/lint/perfdocs/framework_gatherers.py @@ -167,7 +167,7 @@ class RaptorGatherer(FrameworkGatherer): :return list: the list of the tests """ desc_exclusion = ["here", "manifest_relpath", "path", "relpath"] - test_manifest = TestManifest([str(manifest_path)], strict=False) + test_manifest = TestManifest([str(manifest_path)], strict=False, document=True) test_list = test_manifest.active_tests(exists=False, disabled=False) subtests = {} for subtest in test_list: @@ -178,6 +178,20 @@ class RaptorGatherer(FrameworkGatherer): if key not in desc_exclusion: description[key] = value + # Add searchfox link + key = list(test_manifest.source_documents.keys())[0] + + if ( + test_manifest.source_documents[key] + and subtest["name"] in test_manifest.source_documents[key].keys() + ): + description["link searchfox"] = ( + "https://searchfox.org/mozilla-central/source/" + + manifest_path + + "#" + + test_manifest.source_documents[key][subtest["name"]]["lineno"] + ) + # Prepare alerting metrics for verification description["metrics"] = [ metric.strip() @@ -226,7 +240,6 @@ class RaptorGatherer(FrameworkGatherer): browsers = [ "firefox", "chrome", - "chromium", "refbrow", "fennec68", "geckoview", @@ -272,6 +285,8 @@ class RaptorGatherer(FrameworkGatherer): result += f" * **{sub_title}**: `<{description[key]}>`__\n" elif key == "secondary_url": result += f" * **{sub_title}**: `<{description[key]}>`__\n" + elif key == "link searchfox": + result += f" * **{sub_title}**: `<{description[key]}>`__\n" elif key in ["playback_pageset_manifest"]: result += ( f" * **{sub_title}**: " diff --git a/tools/lint/rejected-words.yml b/tools/lint/rejected-words.yml index d45bcf5d08..ed9e8c9d60 100644 --- a/tools/lint/rejected-words.yml +++ b/tools/lint/rejected-words.yml @@ -154,7 +154,16 @@ avoid-blacklist-and-whitelist: - layout/tools/reftest/reftestcommandline.py - layout/tools/reftest/runreftest.py - layout/tools/reftest/selftest/conftest.py + - mobile/android/android-components/components/feature/webcompat/src/main/assets/extensions/webcompat/shims/nielsen.js + - mobile/android/android-components/docs/changelog.md - mobile/android/app/geckoview-prefs.js + - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Bitmap.kt + - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/perf/StrictModeManager.kt + - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/preferences/downloadlanguages/DownloadLanguagesFeature.kt + - mobile/android/fenix/app/src/test/java/org/mozilla/fenix/translations/preferences/downloadlanguages/DownloadLanguagesFeatureTest.kt + - mobile/android/focus-android/app/src/main/res/values-ar/strings.xml + - mobile/android/focus-android/app/src/main/res/values-et/strings.xml + - mobile/android/focus-android/app/src/main/res/values-lt/strings.xml - mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareCodecCapabilityUtils.java - mobile/android/geckoview/src/main/java/org/mozilla/geckoview/ContentBlocking.java - mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java diff --git a/tools/lint/rst/requirements.in b/tools/lint/rst/requirements.in index e6b6022a47..21ff1eeb41 100644 --- a/tools/lint/rst/requirements.in +++ b/tools/lint/rst/requirements.in @@ -1,6 +1,6 @@ alabaster==0.7.13 charset-normalizer==2.0.12 -docutils==0.17.1 +docutils==0.18.1 idna==2.10 imagesize==1.4.1 importlib-metadata==6.0.0 @@ -8,13 +8,13 @@ markupsafe==2.0.1 packaging==21.0 requests==2.27.1 snowballstemmer==2.2.0 -sphinxcontrib-applehelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.0 -sphinxcontrib-mermaid==0.8.1 +sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-mermaid==0.9.2 rstcheck==3.5.0 Pygments==2.14.0 pytz==2022.7.1 urllib3==1.26.9 # We need sphinx to avoid some rstcheck errors and warnings -Sphinx==5.3.0 +Sphinx==7.1.2 pkgutil-resolve-name==1.3.10 ; python_version < '3.9' diff --git a/tools/lint/rst/requirements.txt b/tools/lint/rst/requirements.txt index ded13595c3..ac8de0bba7 100644 --- a/tools/lint/rst/requirements.txt +++ b/tools/lint/rst/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.7 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --config=pyproject.toml --generate-hashes --output-file=tools/lint/rst/requirements.txt ./tools/lint/rst/requirements.in +# pip-compile --generate-hashes --output-file=tools/lint/rst/requirements.txt ./tools/lint/rst/requirements.in # alabaster==0.7.13 \ --hash=sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3 \ @@ -24,9 +24,9 @@ charset-normalizer==2.0.12 \ # via # -r ./tools/lint/rst/requirements.in # requests -docutils==0.17.1 \ - --hash=sha256:686577d2e4c32380bb50cbb22f575ed742d58168cee37e99117a854bcd88f125 \ - --hash=sha256:cf316c8370a737a022b72b56874f6602acf974a37a9fba42ec2876387549fc61 +docutils==0.18.1 \ + --hash=sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c \ + --hash=sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06 # via # -r ./tools/lint/rst/requirements.in # rstcheck @@ -168,13 +168,13 @@ snowballstemmer==2.2.0 \ # via # -r ./tools/lint/rst/requirements.in # sphinx -sphinx==5.3.0 \ - --hash=sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d \ - --hash=sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5 +sphinx==7.1.2 \ + --hash=sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f \ + --hash=sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe # via -r ./tools/lint/rst/requirements.in -sphinxcontrib-applehelp==1.0.2 \ - --hash=sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a \ - --hash=sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58 +sphinxcontrib-applehelp==1.0.4 \ + --hash=sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228 \ + --hash=sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e # via # -r ./tools/lint/rst/requirements.in # sphinx @@ -182,9 +182,9 @@ sphinxcontrib-devhelp==1.0.2 \ --hash=sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e \ --hash=sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4 # via sphinx -sphinxcontrib-htmlhelp==2.0.0 \ - --hash=sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07 \ - --hash=sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2 +sphinxcontrib-htmlhelp==2.0.1 \ + --hash=sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff \ + --hash=sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903 # via # -r ./tools/lint/rst/requirements.in # sphinx @@ -192,9 +192,9 @@ sphinxcontrib-jsmath==1.0.1 \ --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \ --hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8 # via sphinx -sphinxcontrib-mermaid==0.8.1 \ - --hash=sha256:15491c24ec78cf1626b1e79e797a9ce87cb7959cf38f955eb72dd5512aeb6ce9 \ - --hash=sha256:fa3e5325d4ba395336e6137d113f55026b1a03ccd115dc54113d1d871a580466 +sphinxcontrib-mermaid==0.9.2 \ + --hash=sha256:252ef13dd23164b28f16d8b0205cf184b9d8e2b714a302274d9f59eb708e77af \ + --hash=sha256:6795a72037ca55e65663d2a2c1a043d636dc3d30d418e56dd6087d1459d98a5d # via -r ./tools/lint/rst/requirements.in sphinxcontrib-qthelp==1.0.3 \ --hash=sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72 \ @@ -204,10 +204,6 @@ sphinxcontrib-serializinghtml==1.1.5 \ --hash=sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd \ --hash=sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952 # via sphinx -typing-extensions==4.7.1 \ - --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ - --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 - # via importlib-metadata urllib3==1.26.9 \ --hash=sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14 \ --hash=sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e diff --git a/tools/lint/shellcheck.yml b/tools/lint/shellcheck.yml index 0100e3d5cc..b97422ee80 100644 --- a/tools/lint/shellcheck.yml +++ b/tools/lint/shellcheck.yml @@ -4,6 +4,8 @@ shellcheck: include: - extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/ - taskcluster/docker/ + - tools/update-verify/release/common + - tools/update-verify/release/updates exclude: [] # 1090: https://github.com/koalaman/shellcheck/wiki/SC1090 # 'Can't follow a non-constant source' diff --git a/tools/lint/trojan-source.yml b/tools/lint/trojan-source.yml index 611ab660f5..a273626b58 100644 --- a/tools/lint/trojan-source.yml +++ b/tools/lint/trojan-source.yml @@ -14,6 +14,7 @@ trojan-source: - third_party/python/arrow/arrow/locales.py - third_party/rust/chardetng/src/data.rs - third_party/rust/clap_builder/src/output/textwrap/core.rs + - third_party/rust/textwrap/src/core.rs - third_party/rust/icu_provider/src/hello_world.rs - third_party/rust/uniffi-example-rondpoint/tests/bindings/test_rondpoint.py - third_party/rust/error-chain/tests/tests.rs |