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:
+72
-78
@@ -9,93 +9,87 @@
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
defaultOptions: [{ exceptions: [] }],
|
||||
docs: {
|
||||
description: "Disallow assignments to native objects or read-only global variables",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-global-assign"
|
||||
},
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow assignments to native objects or read-only global variables",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-global-assign",
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
exceptions: {
|
||||
type: "array",
|
||||
items: { type: "string" },
|
||||
uniqueItems: true
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
exceptions: {
|
||||
type: "array",
|
||||
items: { type: "string" },
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
messages: {
|
||||
globalShouldNotBeModified: "Read-only global '{{name}}' should not be modified."
|
||||
}
|
||||
},
|
||||
|
||||
messages: {
|
||||
globalShouldNotBeModified:
|
||||
"Read-only global '{{name}}' should not be modified.",
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
const config = context.options[0];
|
||||
const sourceCode = context.sourceCode;
|
||||
const exceptions = (config && config.exceptions) || [];
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
const [{ exceptions }] = context.options;
|
||||
/**
|
||||
* Reports write references.
|
||||
* @param {Reference} reference A reference to check.
|
||||
* @param {int} index The index of the reference in the references.
|
||||
* @param {Reference[]} references The array that the reference belongs to.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkReference(reference, index, references) {
|
||||
const identifier = reference.identifier;
|
||||
|
||||
/**
|
||||
* Reports write references.
|
||||
* @param {Reference} reference A reference to check.
|
||||
* @param {number} index The index of the reference in the references.
|
||||
* @param {Reference[]} references The array that the reference belongs to.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkReference(reference, index, references) {
|
||||
const identifier = reference.identifier;
|
||||
if (reference.init === false &&
|
||||
reference.isWrite() &&
|
||||
|
||||
if (
|
||||
reference.init === false &&
|
||||
reference.isWrite() &&
|
||||
/*
|
||||
* Destructuring assignments can have multiple default value,
|
||||
* so possibly there are multiple writeable references for the same identifier.
|
||||
*/
|
||||
(index === 0 || references[index - 1].identifier !== identifier)
|
||||
) {
|
||||
context.report({
|
||||
node: identifier,
|
||||
messageId: "globalShouldNotBeModified",
|
||||
data: {
|
||||
name: identifier.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Destructuring assignments can have multiple default value,
|
||||
* so possibly there are multiple writeable references for the same identifier.
|
||||
*/
|
||||
(index === 0 || references[index - 1].identifier !== identifier)
|
||||
) {
|
||||
context.report({
|
||||
node: identifier,
|
||||
messageId: "globalShouldNotBeModified",
|
||||
data: {
|
||||
name: identifier.name
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports write references if a given variable is read-only builtin.
|
||||
* @param {Variable} variable A variable to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkVariable(variable) {
|
||||
if (
|
||||
variable.writeable === false &&
|
||||
!exceptions.includes(variable.name)
|
||||
) {
|
||||
variable.references.forEach(checkReference);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Reports write references if a given variable is read-only builtin.
|
||||
* @param {Variable} variable A variable to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkVariable(variable) {
|
||||
if (variable.writeable === false && !exceptions.includes(variable.name)) {
|
||||
variable.references.forEach(checkReference);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
Program(node) {
|
||||
const globalScope = sourceCode.getScope(node);
|
||||
return {
|
||||
Program(node) {
|
||||
const globalScope = sourceCode.getScope(node);
|
||||
|
||||
globalScope.variables.forEach(checkVariable);
|
||||
},
|
||||
};
|
||||
},
|
||||
globalScope.variables.forEach(checkVariable);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user