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:
+35
-52
@@ -5,69 +5,52 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const CONSTANT_BINDINGS = new Set(["const", "using", "await using"]);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "problem",
|
||||
meta: {
|
||||
type: "problem",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow reassigning `const`, `using`, and `await using` variables",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-const-assign",
|
||||
},
|
||||
docs: {
|
||||
description: "Disallow reassigning `const` variables",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-const-assign"
|
||||
},
|
||||
|
||||
schema: [],
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
const: "'{{name}}' is constant.",
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
const: "'{{name}}' is constant."
|
||||
}
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
create(context) {
|
||||
|
||||
/**
|
||||
* Finds and reports references that are non initializer and writable.
|
||||
* @param {Variable} variable A variable to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkVariable(variable) {
|
||||
astUtils
|
||||
.getModifyingReferences(variable.references)
|
||||
.forEach(reference => {
|
||||
context.report({
|
||||
node: reference.identifier,
|
||||
messageId: "const",
|
||||
data: { name: reference.identifier.name },
|
||||
});
|
||||
});
|
||||
}
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
return {
|
||||
VariableDeclaration(node) {
|
||||
if (CONSTANT_BINDINGS.has(node.kind)) {
|
||||
sourceCode
|
||||
.getDeclaredVariables(node)
|
||||
.forEach(checkVariable);
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Finds and reports references that are non initializer and writable.
|
||||
* @param {Variable} variable A variable to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkVariable(variable) {
|
||||
astUtils.getModifyingReferences(variable.references).forEach(reference => {
|
||||
context.report({ node: reference.identifier, messageId: "const", data: { name: reference.identifier.name } });
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
VariableDeclaration(node) {
|
||||
if (node.kind === "const") {
|
||||
sourceCode.getDeclaredVariables(node).forEach(checkVariable);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user