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:
+59
-58
@@ -8,78 +8,79 @@
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description: "Disallow the use of `undefined` as an identifier",
|
||||
recommended: false,
|
||||
frozen: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-undefined",
|
||||
},
|
||||
docs: {
|
||||
description: "Disallow the use of `undefined` as an identifier",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-undefined"
|
||||
},
|
||||
|
||||
schema: [],
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
unexpectedUndefined: "Unexpected use of undefined.",
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
unexpectedUndefined: "Unexpected use of undefined."
|
||||
}
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
create(context) {
|
||||
|
||||
/**
|
||||
* Report an invalid "undefined" identifier node.
|
||||
* @param {ASTNode} node The node to report.
|
||||
* @returns {void}
|
||||
*/
|
||||
function report(node) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpectedUndefined",
|
||||
});
|
||||
}
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
/**
|
||||
* Checks the given scope for references to `undefined` and reports
|
||||
* all references found.
|
||||
* @param {eslint-scope.Scope} scope The scope to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkScope(scope) {
|
||||
const undefinedVar = scope.set.get("undefined");
|
||||
/**
|
||||
* Report an invalid "undefined" identifier node.
|
||||
* @param {ASTNode} node The node to report.
|
||||
* @returns {void}
|
||||
*/
|
||||
function report(node) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpectedUndefined"
|
||||
});
|
||||
}
|
||||
|
||||
if (!undefinedVar) {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Checks the given scope for references to `undefined` and reports
|
||||
* all references found.
|
||||
* @param {eslint-scope.Scope} scope The scope to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkScope(scope) {
|
||||
const undefinedVar = scope.set.get("undefined");
|
||||
|
||||
const references = undefinedVar.references;
|
||||
if (!undefinedVar) {
|
||||
return;
|
||||
}
|
||||
|
||||
const defs = undefinedVar.defs;
|
||||
const references = undefinedVar.references;
|
||||
|
||||
// Report non-initializing references (those are covered in defs below)
|
||||
references
|
||||
.filter(ref => !ref.init)
|
||||
.forEach(ref => report(ref.identifier));
|
||||
const defs = undefinedVar.defs;
|
||||
|
||||
defs.forEach(def => report(def.name));
|
||||
}
|
||||
// Report non-initializing references (those are covered in defs below)
|
||||
references
|
||||
.filter(ref => !ref.init)
|
||||
.forEach(ref => report(ref.identifier));
|
||||
|
||||
return {
|
||||
"Program:exit"(node) {
|
||||
const globalScope = sourceCode.getScope(node);
|
||||
defs.forEach(def => report(def.name));
|
||||
}
|
||||
|
||||
const stack = [globalScope];
|
||||
return {
|
||||
"Program:exit"(node) {
|
||||
const globalScope = sourceCode.getScope(node);
|
||||
|
||||
while (stack.length) {
|
||||
const scope = stack.pop();
|
||||
const stack = [globalScope];
|
||||
|
||||
stack.push(...scope.childScopes);
|
||||
checkScope(scope);
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
while (stack.length) {
|
||||
const scope = stack.pop();
|
||||
|
||||
stack.push(...scope.childScopes);
|
||||
checkScope(scope);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user