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:
+43
-47
@@ -17,12 +17,12 @@ const astUtils = require("./utils/ast-utils");
|
||||
* @returns {boolean} Whether or not the node is a `.apply()` for variadic.
|
||||
*/
|
||||
function isVariadicApplyCalling(node) {
|
||||
return (
|
||||
astUtils.isSpecificMemberAccess(node.callee, null, "apply") &&
|
||||
node.arguments.length === 2 &&
|
||||
node.arguments[1].type !== "ArrayExpression" &&
|
||||
node.arguments[1].type !== "SpreadElement"
|
||||
);
|
||||
return (
|
||||
astUtils.isSpecificMemberAccess(node.callee, null, "apply") &&
|
||||
node.arguments.length === 2 &&
|
||||
node.arguments[1].type !== "ArrayExpression" &&
|
||||
node.arguments[1].type !== "SpreadElement"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,59 +33,55 @@ function isVariadicApplyCalling(node) {
|
||||
* @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`.
|
||||
*/
|
||||
function isValidThisArg(expectedThis, thisArg, context) {
|
||||
if (!expectedThis) {
|
||||
return astUtils.isNullOrUndefined(thisArg);
|
||||
}
|
||||
return astUtils.equalTokens(expectedThis, thisArg, context);
|
||||
if (!expectedThis) {
|
||||
return astUtils.isNullOrUndefined(thisArg);
|
||||
}
|
||||
return astUtils.equalTokens(expectedThis, thisArg, context);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description: "Require spread operators instead of `.apply()`",
|
||||
recommended: false,
|
||||
frozen: true,
|
||||
url: "https://eslint.org/docs/latest/rules/prefer-spread",
|
||||
},
|
||||
docs: {
|
||||
description: "Require spread operators instead of `.apply()`",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/prefer-spread"
|
||||
},
|
||||
|
||||
schema: [],
|
||||
fixable: null,
|
||||
schema: [],
|
||||
fixable: null,
|
||||
|
||||
messages: {
|
||||
preferSpread: "Use the spread operator instead of '.apply()'.",
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
preferSpread: "Use the spread operator instead of '.apply()'."
|
||||
}
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
return {
|
||||
CallExpression(node) {
|
||||
if (!isVariadicApplyCalling(node)) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
CallExpression(node) {
|
||||
if (!isVariadicApplyCalling(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const applied = astUtils.skipChainExpression(
|
||||
astUtils.skipChainExpression(node.callee).object,
|
||||
);
|
||||
const expectedThis =
|
||||
applied.type === "MemberExpression" ? applied.object : null;
|
||||
const thisArg = node.arguments[0];
|
||||
const applied = astUtils.skipChainExpression(astUtils.skipChainExpression(node.callee).object);
|
||||
const expectedThis = (applied.type === "MemberExpression") ? applied.object : null;
|
||||
const thisArg = node.arguments[0];
|
||||
|
||||
if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "preferSpread",
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "preferSpread"
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user