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:
+56
-53
@@ -16,9 +16,9 @@
|
||||
* @returns {boolean} `true` if the node is `ForStatement` update.
|
||||
*/
|
||||
function isForStatementUpdate(node) {
|
||||
const parent = node.parent;
|
||||
const parent = node.parent;
|
||||
|
||||
return parent.type === "ForStatement" && parent.update === node;
|
||||
return parent.type === "ForStatement" && parent.update === node;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,71 +32,74 @@ function isForStatementUpdate(node) {
|
||||
* @returns {boolean} `true` if the node is a for loop afterthought.
|
||||
*/
|
||||
function isForLoopAfterthought(node) {
|
||||
const parent = node.parent;
|
||||
const parent = node.parent;
|
||||
|
||||
if (parent.type === "SequenceExpression") {
|
||||
return isForLoopAfterthought(parent);
|
||||
}
|
||||
if (parent.type === "SequenceExpression") {
|
||||
return isForLoopAfterthought(parent);
|
||||
}
|
||||
|
||||
return isForStatementUpdate(node);
|
||||
return isForStatementUpdate(node);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
defaultOptions: [
|
||||
{
|
||||
allowForLoopAfterthoughts: false,
|
||||
},
|
||||
],
|
||||
docs: {
|
||||
description: "Disallow the unary operators `++` and `--`",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-plusplus"
|
||||
},
|
||||
|
||||
docs: {
|
||||
description: "Disallow the unary operators `++` and `--`",
|
||||
recommended: false,
|
||||
frozen: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-plusplus",
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
allowForLoopAfterthoughts: {
|
||||
type: "boolean",
|
||||
default: false
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
allowForLoopAfterthoughts: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
messages: {
|
||||
unexpectedUnaryOp: "Unary operator '{{operator}}' used."
|
||||
}
|
||||
},
|
||||
|
||||
messages: {
|
||||
unexpectedUnaryOp: "Unary operator '{{operator}}' used.",
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
|
||||
create(context) {
|
||||
const [{ allowForLoopAfterthoughts }] = context.options;
|
||||
const config = context.options[0];
|
||||
let allowForLoopAfterthoughts = false;
|
||||
|
||||
return {
|
||||
UpdateExpression(node) {
|
||||
if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) {
|
||||
return;
|
||||
}
|
||||
if (typeof config === "object") {
|
||||
allowForLoopAfterthoughts = config.allowForLoopAfterthoughts === true;
|
||||
}
|
||||
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpectedUnaryOp",
|
||||
data: {
|
||||
operator: node.operator,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
return {
|
||||
|
||||
UpdateExpression(node) {
|
||||
if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpectedUnaryOp",
|
||||
data: {
|
||||
operator: node.operator
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user