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:
1 parent
20129a1ac7
commit
ac4f232e5e
787 files changed
+82341
-121690
No files matched your search
+49
-76
@@ -7,15 +7,15 @@
|
||||
"use strict";
|
||||
|
||||
const ACCEPTABLE_PARENTS = new Set([
|
||||
"AssignmentExpression",
|
||||
"VariableDeclarator",
|
||||
"MemberExpression",
|
||||
"ExpressionStatement",
|
||||
"CallExpression",
|
||||
"ConditionalExpression",
|
||||
"Program",
|
||||
"VariableDeclaration",
|
||||
"ChainExpression",
|
||||
"AssignmentExpression",
|
||||
"VariableDeclarator",
|
||||
"MemberExpression",
|
||||
"ExpressionStatement",
|
||||
"CallExpression",
|
||||
"ConditionalExpression",
|
||||
"Program",
|
||||
"VariableDeclaration",
|
||||
"ChainExpression"
|
||||
]);
|
||||
|
||||
/**
|
||||
@@ -25,18 +25,16 @@ const ACCEPTABLE_PARENTS = new Set([
|
||||
* @returns {Reference|null} Returns the found reference or null if none were found.
|
||||
*/
|
||||
function findReference(scope, node) {
|
||||
const references = scope.references.filter(
|
||||
reference =>
|
||||
reference.identifier.range[0] === node.range[0] &&
|
||||
reference.identifier.range[1] === node.range[1],
|
||||
);
|
||||
const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
|
||||
reference.identifier.range[1] === node.range[1]);
|
||||
|
||||
if (references.length === 1) {
|
||||
return references[0];
|
||||
}
|
||||
if (references.length === 1) {
|
||||
return references[0];
|
||||
}
|
||||
|
||||
/* c8 ignore next */
|
||||
return null;
|
||||
|
||||
/* c8 ignore next */
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,72 +44,47 @@ function findReference(scope, node) {
|
||||
* @returns {boolean} Whether or not the name is shadowed.
|
||||
*/
|
||||
function isShadowed(scope, node) {
|
||||
const reference = findReference(scope, node);
|
||||
const reference = findReference(scope, node);
|
||||
|
||||
return (
|
||||
reference && reference.resolved && reference.resolved.defs.length > 0
|
||||
);
|
||||
return reference && reference.resolved && reference.resolved.defs.length > 0;
|
||||
}
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
deprecated: {
|
||||
message: "Node.js rules were moved out of ESLint core.",
|
||||
url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
|
||||
deprecatedSince: "7.0.0",
|
||||
availableUntil: "11.0.0",
|
||||
replacedBy: [
|
||||
{
|
||||
message:
|
||||
"eslint-plugin-n now maintains deprecated Node.js-related rules.",
|
||||
plugin: {
|
||||
name: "eslint-plugin-n",
|
||||
url: "https://github.com/eslint-community/eslint-plugin-n",
|
||||
},
|
||||
rule: {
|
||||
name: "global-require",
|
||||
url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/global-require.md",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
meta: {
|
||||
deprecated: true,
|
||||
|
||||
type: "suggestion",
|
||||
replacedBy: [],
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Require `require()` calls to be placed at top-level module scope",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/global-require",
|
||||
},
|
||||
type: "suggestion",
|
||||
|
||||
schema: [],
|
||||
messages: {
|
||||
unexpected: "Unexpected require().",
|
||||
},
|
||||
},
|
||||
docs: {
|
||||
description: "Require `require()` calls to be placed at top-level module scope",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/global-require"
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
schema: [],
|
||||
messages: {
|
||||
unexpected: "Unexpected require()."
|
||||
}
|
||||
},
|
||||
|
||||
return {
|
||||
CallExpression(node) {
|
||||
const currentScope = sourceCode.getScope(node);
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
if (
|
||||
node.callee.name === "require" &&
|
||||
!isShadowed(currentScope, node.callee)
|
||||
) {
|
||||
const isGoodRequire = sourceCode
|
||||
.getAncestors(node)
|
||||
.every(parent => ACCEPTABLE_PARENTS.has(parent.type));
|
||||
return {
|
||||
CallExpression(node) {
|
||||
const currentScope = sourceCode.getScope(node);
|
||||
|
||||
if (!isGoodRequire) {
|
||||
context.report({ node, messageId: "unexpected" });
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) {
|
||||
const isGoodRequire = sourceCode.getAncestors(node).every(parent => ACCEPTABLE_PARENTS.has(parent.type));
|
||||
|
||||
if (!isGoodRequire) {
|
||||
context.report({ node, messageId: "unexpected" });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user