build: update npm install command to use --legacy-peer-deps

This change modifies the build scripts to use --legacy-peer-deps flag when installing npm dependencies to resolve potential peer dependency conflicts during the build process. The change is applied to both bash (build.sh) and batch (build.bat) build scripts.
This commit is contained in:
Luiz Costa
2025-11-18 10:23:55 -03:00
parent 20129a1ac7
commit ac4f232e5e
787 changed files with 82341 additions and 121690 deletions
+36 -84
View File
@@ -1,5 +1,5 @@
/**
* @fileoverview Disallow shadowing of globalThis, NaN, undefined, and Infinity (ES2020 section 18.1)
* @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1)
* @author Michael Ficarra
*/
"use strict";
@@ -12,102 +12,54 @@
* @returns {boolean} true if this variable safely shadows `undefined`
*/
function safelyShadowsUndefined(variable) {
return (
variable.name === "undefined" &&
variable.references.every(ref => !ref.isWrite()) &&
variable.defs.every(
def =>
def.node.type === "VariableDeclarator" &&
def.node.init === null,
)
);
return variable.name === "undefined" &&
variable.references.every(ref => !ref.isWrite()) &&
variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
meta: {
type: "suggestion",
defaultOptions: [
{
reportGlobalThis: false,
},
],
docs: {
description: "Disallow identifiers from shadowing restricted names",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names"
},
docs: {
description: "Disallow identifiers from shadowing restricted names",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names",
},
schema: [],
schema: [
{
type: "object",
properties: {
reportGlobalThis: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
shadowingRestrictedName: "Shadowing of global property '{{name}}'."
}
},
messages: {
shadowingRestrictedName: "Shadowing of global property '{{name}}'.",
},
},
create(context) {
create(context) {
const [{ reportGlobalThis }] = context.options;
const RESTRICTED = new Set([
"undefined",
"NaN",
"Infinity",
"arguments",
"eval",
]);
const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]);
const sourceCode = context.sourceCode;
if (reportGlobalThis) {
RESTRICTED.add("globalThis");
}
return {
"VariableDeclaration, :function, CatchClause"(node) {
for (const variable of sourceCode.getDeclaredVariables(node)) {
if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) {
context.report({
node: variable.defs[0].name,
messageId: "shadowingRestrictedName",
data: {
name: variable.name
}
});
}
}
}
};
const sourceCode = context.sourceCode;
// Track reported nodes to avoid duplicate reports. For example, on class declarations.
const reportedNodes = new Set();
return {
"VariableDeclaration, :function, CatchClause, ImportDeclaration, ClassDeclaration, ClassExpression"(
node,
) {
for (const variable of sourceCode.getDeclaredVariables(node)) {
if (
variable.defs.length > 0 &&
RESTRICTED.has(variable.name) &&
!safelyShadowsUndefined(variable)
) {
for (const def of variable.defs) {
const nodeToReport = def.name;
if (!reportedNodes.has(nodeToReport)) {
reportedNodes.add(nodeToReport);
context.report({
node: nodeToReport,
messageId: "shadowingRestrictedName",
data: {
name: variable.name,
},
});
}
}
}
}
},
};
},
}
};