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:
+42
-49
@@ -22,62 +22,55 @@ const QUICK_TEST_REGEX = /\[\]/u;
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "problem",
|
||||
meta: {
|
||||
type: "problem",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow empty character classes in regular expressions",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-empty-character-class",
|
||||
},
|
||||
docs: {
|
||||
description: "Disallow empty character classes in regular expressions",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-empty-character-class"
|
||||
},
|
||||
|
||||
schema: [],
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
unexpected: "Empty class.",
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
unexpected: "Empty class."
|
||||
}
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
"Literal[regex]"(node) {
|
||||
const { pattern, flags } = node.regex;
|
||||
create(context) {
|
||||
return {
|
||||
"Literal[regex]"(node) {
|
||||
const { pattern, flags } = node.regex;
|
||||
|
||||
if (!QUICK_TEST_REGEX.test(pattern)) {
|
||||
return;
|
||||
}
|
||||
if (!QUICK_TEST_REGEX.test(pattern)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let regExpAST;
|
||||
let regExpAST;
|
||||
|
||||
try {
|
||||
regExpAST = parser.parsePattern(
|
||||
pattern,
|
||||
0,
|
||||
pattern.length,
|
||||
{
|
||||
unicode: flags.includes("u"),
|
||||
unicodeSets: flags.includes("v"),
|
||||
},
|
||||
);
|
||||
} catch {
|
||||
// Ignore regular expressions that regexpp cannot parse
|
||||
return;
|
||||
}
|
||||
try {
|
||||
regExpAST = parser.parsePattern(pattern, 0, pattern.length, {
|
||||
unicode: flags.includes("u"),
|
||||
unicodeSets: flags.includes("v")
|
||||
});
|
||||
} catch {
|
||||
|
||||
visitRegExpAST(regExpAST, {
|
||||
onCharacterClassEnter(characterClass) {
|
||||
if (
|
||||
!characterClass.negate &&
|
||||
characterClass.elements.length === 0
|
||||
) {
|
||||
context.report({ node, messageId: "unexpected" });
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
// Ignore regular expressions that regexpp cannot parse
|
||||
return;
|
||||
}
|
||||
|
||||
visitRegExpAST(regExpAST, {
|
||||
onCharacterClassEnter(characterClass) {
|
||||
if (!characterClass.negate && characterClass.elements.length === 0) {
|
||||
context.report({ node, messageId: "unexpected" });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user