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
+82 -89
View File
@@ -10,115 +10,108 @@
//------------------------------------------------------------------------------
const {
getVariableByName,
isArrowToken,
isStartOfExpressionStatement,
needsPrecedingSemicolon,
getVariableByName,
isArrowToken,
isStartOfExpressionStatement,
needsPrecedingSemicolon
} = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
meta: {
type: "suggestion",
docs: {
description:
"Disallow calls to the `Object` constructor without an argument",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-object-constructor",
},
docs: {
description: "Disallow calls to the `Object` constructor without an argument",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-object-constructor"
},
hasSuggestions: true,
hasSuggestions: true,
schema: [],
schema: [],
messages: {
preferLiteral: "The object literal notation {} is preferable.",
useLiteral: "Replace with '{{replacement}}'.",
useLiteralAfterSemicolon:
"Replace with '{{replacement}}', add preceding semicolon.",
},
},
messages: {
preferLiteral: "The object literal notation {} is preferable.",
useLiteral: "Replace with '{{replacement}}'.",
useLiteralAfterSemicolon: "Replace with '{{replacement}}', add preceding semicolon."
}
},
create(context) {
const sourceCode = context.sourceCode;
create(context) {
/**
* Determines whether or not an object literal that replaces a specified node needs to be enclosed in parentheses.
* @param {ASTNode} node The node to be replaced.
* @returns {boolean} Whether or not parentheses around the object literal are required.
*/
function needsParentheses(node) {
if (isStartOfExpressionStatement(node)) {
return true;
}
const sourceCode = context.sourceCode;
const prevToken = sourceCode.getTokenBefore(node);
/**
* Determines whether or not an object literal that replaces a specified node needs to be enclosed in parentheses.
* @param {ASTNode} node The node to be replaced.
* @returns {boolean} Whether or not parentheses around the object literal are required.
*/
function needsParentheses(node) {
if (isStartOfExpressionStatement(node)) {
return true;
}
if (prevToken && isArrowToken(prevToken)) {
return true;
}
const prevToken = sourceCode.getTokenBefore(node);
return false;
}
if (prevToken && isArrowToken(prevToken)) {
return true;
}
/**
* Reports on nodes where the `Object` constructor is called without arguments.
* @param {ASTNode} node The node to evaluate.
* @returns {void}
*/
function check(node) {
if (
node.callee.type !== "Identifier" ||
node.callee.name !== "Object" ||
node.arguments.length
) {
return;
}
return false;
}
const variable = getVariableByName(
sourceCode.getScope(node),
"Object",
);
/**
* Reports on nodes where the `Object` constructor is called without arguments.
* @param {ASTNode} node The node to evaluate.
* @returns {void}
*/
function check(node) {
if (node.callee.type !== "Identifier" || node.callee.name !== "Object" || node.arguments.length) {
return;
}
if (variable && variable.identifiers.length === 0) {
let replacement;
let fixText;
let messageId = "useLiteral";
const variable = getVariableByName(sourceCode.getScope(node), "Object");
if (needsParentheses(node)) {
replacement = "({})";
if (needsPrecedingSemicolon(sourceCode, node)) {
fixText = ";({})";
messageId = "useLiteralAfterSemicolon";
} else {
fixText = "({})";
}
} else {
replacement = fixText = "{}";
}
if (variable && variable.identifiers.length === 0) {
let replacement;
let fixText;
let messageId = "useLiteral";
context.report({
node,
messageId: "preferLiteral",
suggest: [
{
messageId,
data: { replacement },
fix: fixer => fixer.replaceText(node, fixText),
},
],
});
}
}
if (needsParentheses(node)) {
replacement = "({})";
if (needsPrecedingSemicolon(sourceCode, node)) {
fixText = ";({})";
messageId = "useLiteralAfterSemicolon";
} else {
fixText = "({})";
}
} else {
replacement = fixText = "{}";
}
return {
CallExpression: check,
NewExpression: check,
};
},
context.report({
node,
messageId: "preferLiteral",
suggest: [
{
messageId,
data: { replacement },
fix: fixer => fixer.replaceText(node, fixText)
}
]
});
}
}
return {
CallExpression: check,
NewExpression: check
};
}
};