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
+131 -134
View File
@@ -28,159 +28,156 @@ const SPACES = /\s+/gu;
* @returns {void}
*/
function eachSelfAssignment(left, right, props, report) {
if (!left || !right) {
// do nothing
} else if (
left.type === "Identifier" &&
right.type === "Identifier" &&
left.name === right.name
) {
report(right);
} else if (
left.type === "ArrayPattern" &&
right.type === "ArrayExpression"
) {
const end = Math.min(left.elements.length, right.elements.length);
if (!left || !right) {
for (let i = 0; i < end; ++i) {
const leftElement = left.elements[i];
const rightElement = right.elements[i];
// do nothing
} else if (
left.type === "Identifier" &&
right.type === "Identifier" &&
left.name === right.name
) {
report(right);
} else if (
left.type === "ArrayPattern" &&
right.type === "ArrayExpression"
) {
const end = Math.min(left.elements.length, right.elements.length);
// Avoid cases such as [...a] = [...a, 1]
if (
leftElement &&
leftElement.type === "RestElement" &&
i < right.elements.length - 1
) {
break;
}
for (let i = 0; i < end; ++i) {
const leftElement = left.elements[i];
const rightElement = right.elements[i];
eachSelfAssignment(leftElement, rightElement, props, report);
// Avoid cases such as [...a] = [...a, 1]
if (
leftElement &&
leftElement.type === "RestElement" &&
i < right.elements.length - 1
) {
break;
}
// After a spread element, those indices are unknown.
if (rightElement && rightElement.type === "SpreadElement") {
break;
}
}
} else if (left.type === "RestElement" && right.type === "SpreadElement") {
eachSelfAssignment(left.argument, right.argument, props, report);
} else if (
left.type === "ObjectPattern" &&
right.type === "ObjectExpression" &&
right.properties.length >= 1
) {
/*
* Gets the index of the last spread property.
* It's possible to overwrite properties followed by it.
*/
let startJ = 0;
eachSelfAssignment(leftElement, rightElement, props, report);
for (let i = right.properties.length - 1; i >= 0; --i) {
const propType = right.properties[i].type;
// After a spread element, those indices are unknown.
if (rightElement && rightElement.type === "SpreadElement") {
break;
}
}
} else if (
left.type === "RestElement" &&
right.type === "SpreadElement"
) {
eachSelfAssignment(left.argument, right.argument, props, report);
} else if (
left.type === "ObjectPattern" &&
right.type === "ObjectExpression" &&
right.properties.length >= 1
) {
if (
propType === "SpreadElement" ||
propType === "ExperimentalSpreadProperty"
) {
startJ = i + 1;
break;
}
}
/*
* Gets the index of the last spread property.
* It's possible to overwrite properties followed by it.
*/
let startJ = 0;
for (let i = 0; i < left.properties.length; ++i) {
for (let j = startJ; j < right.properties.length; ++j) {
eachSelfAssignment(
left.properties[i],
right.properties[j],
props,
report,
);
}
}
} else if (
left.type === "Property" &&
right.type === "Property" &&
right.kind === "init" &&
!right.method
) {
const leftName = astUtils.getStaticPropertyName(left);
for (let i = right.properties.length - 1; i >= 0; --i) {
const propType = right.properties[i].type;
if (
leftName !== null &&
leftName === astUtils.getStaticPropertyName(right)
) {
eachSelfAssignment(left.value, right.value, props, report);
}
} else if (
props &&
astUtils.skipChainExpression(left).type === "MemberExpression" &&
astUtils.skipChainExpression(right).type === "MemberExpression" &&
astUtils.isSameReference(left, right)
) {
report(right);
}
if (propType === "SpreadElement" || propType === "ExperimentalSpreadProperty") {
startJ = i + 1;
break;
}
}
for (let i = 0; i < left.properties.length; ++i) {
for (let j = startJ; j < right.properties.length; ++j) {
eachSelfAssignment(
left.properties[i],
right.properties[j],
props,
report
);
}
}
} else if (
left.type === "Property" &&
right.type === "Property" &&
right.kind === "init" &&
!right.method
) {
const leftName = astUtils.getStaticPropertyName(left);
if (leftName !== null && leftName === astUtils.getStaticPropertyName(right)) {
eachSelfAssignment(left.value, right.value, props, report);
}
} else if (
props &&
astUtils.skipChainExpression(left).type === "MemberExpression" &&
astUtils.skipChainExpression(right).type === "MemberExpression" &&
astUtils.isSameReference(left, right)
) {
report(right);
}
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
meta: {
type: "problem",
defaultOptions: [{ props: true }],
docs: {
description: "Disallow assignments where both sides are exactly the same",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-self-assign"
},
docs: {
description:
"Disallow assignments where both sides are exactly the same",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-self-assign",
},
schema: [
{
type: "object",
properties: {
props: {
type: "boolean",
default: true
}
},
additionalProperties: false
}
],
schema: [
{
type: "object",
properties: {
props: {
type: "boolean",
},
},
additionalProperties: false,
},
],
messages: {
selfAssignment: "'{{name}}' is assigned to itself."
}
},
messages: {
selfAssignment: "'{{name}}' is assigned to itself.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const [{ props = true } = {}] = context.options;
create(context) {
const sourceCode = context.sourceCode;
const [{ props }] = context.options;
/**
* Reports a given node as self assignments.
* @param {ASTNode} node A node to report. This is an Identifier node.
* @returns {void}
*/
function report(node) {
context.report({
node,
messageId: "selfAssignment",
data: {
name: sourceCode.getText(node).replace(SPACES, "")
}
});
}
/**
* Reports a given node as self assignments.
* @param {ASTNode} node A node to report. This is an Identifier node.
* @returns {void}
*/
function report(node) {
context.report({
node,
messageId: "selfAssignment",
data: {
name: sourceCode.getText(node).replace(SPACES, ""),
},
});
}
return {
AssignmentExpression(node) {
if (["=", "&&=", "||=", "??="].includes(node.operator)) {
eachSelfAssignment(node.left, node.right, props, report);
}
},
};
},
return {
AssignmentExpression(node) {
if (["=", "&&=", "||=", "??="].includes(node.operator)) {
eachSelfAssignment(node.left, node.right, props, report);
}
}
};
}
};