From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../lib/rules/reject-multiple-getters-calls.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-multiple-getters-calls.js') 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)) { -- cgit v1.2.3