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:
+88
-120
@@ -9,140 +9,108 @@
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
deprecated: {
|
||||
message: "Formatting rules are being moved out of ESLint core.",
|
||||
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
||||
deprecatedSince: "8.53.0",
|
||||
availableUntil: "11.0.0",
|
||||
replacedBy: [
|
||||
{
|
||||
message:
|
||||
"ESLint Stylistic now maintains deprecated stylistic core rules.",
|
||||
url: "https://eslint.style/guide/migration",
|
||||
plugin: {
|
||||
name: "@stylistic/eslint-plugin",
|
||||
url: "https://eslint.style",
|
||||
},
|
||||
rule: {
|
||||
name: "no-mixed-spaces-and-tabs",
|
||||
url: "https://eslint.style/rules/no-mixed-spaces-and-tabs",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
type: "layout",
|
||||
meta: {
|
||||
deprecated: true,
|
||||
replacedBy: [],
|
||||
type: "layout",
|
||||
|
||||
docs: {
|
||||
description: "Disallow mixed spaces and tabs for indentation",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs",
|
||||
},
|
||||
docs: {
|
||||
description: "Disallow mixed spaces and tabs for indentation",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs"
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
enum: ["smart-tabs", true, false],
|
||||
},
|
||||
],
|
||||
schema: [
|
||||
{
|
||||
enum: ["smart-tabs", true, false]
|
||||
}
|
||||
],
|
||||
|
||||
messages: {
|
||||
mixedSpacesAndTabs: "Mixed spaces and tabs.",
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
mixedSpacesAndTabs: "Mixed spaces and tabs."
|
||||
}
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
let smartTabs;
|
||||
let smartTabs;
|
||||
|
||||
switch (context.options[0]) {
|
||||
case true: // Support old syntax, maybe add deprecation warning here
|
||||
case "smart-tabs":
|
||||
smartTabs = true;
|
||||
break;
|
||||
default:
|
||||
smartTabs = false;
|
||||
}
|
||||
switch (context.options[0]) {
|
||||
case true: // Support old syntax, maybe add deprecation warning here
|
||||
case "smart-tabs":
|
||||
smartTabs = true;
|
||||
break;
|
||||
default:
|
||||
smartTabs = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Public
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Public
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
return {
|
||||
"Program:exit"(node) {
|
||||
const lines = sourceCode.lines,
|
||||
comments = sourceCode.getAllComments(),
|
||||
ignoredCommentLines = new Set();
|
||||
return {
|
||||
|
||||
// Add all lines except the first ones.
|
||||
comments.forEach(comment => {
|
||||
for (
|
||||
let i = comment.loc.start.line + 1;
|
||||
i <= comment.loc.end.line;
|
||||
i++
|
||||
) {
|
||||
ignoredCommentLines.add(i);
|
||||
}
|
||||
});
|
||||
"Program:exit"(node) {
|
||||
const lines = sourceCode.lines,
|
||||
comments = sourceCode.getAllComments(),
|
||||
ignoredCommentLines = new Set();
|
||||
|
||||
/*
|
||||
* At least one space followed by a tab
|
||||
* or the reverse before non-tab/-space
|
||||
* characters begin.
|
||||
*/
|
||||
let regex = /^(?=( +|\t+))\1(?:\t| )/u;
|
||||
// Add all lines except the first ones.
|
||||
comments.forEach(comment => {
|
||||
for (let i = comment.loc.start.line + 1; i <= comment.loc.end.line; i++) {
|
||||
ignoredCommentLines.add(i);
|
||||
}
|
||||
});
|
||||
|
||||
if (smartTabs) {
|
||||
/*
|
||||
* At least one space followed by a tab
|
||||
* before non-tab/-space characters begin.
|
||||
*/
|
||||
// eslint-disable-next-line regexp/no-empty-lookarounds-assertion -- False positive
|
||||
regex = /^(?=(\t*))\1(?=( +))\2\t/u;
|
||||
}
|
||||
/*
|
||||
* At least one space followed by a tab
|
||||
* or the reverse before non-tab/-space
|
||||
* characters begin.
|
||||
*/
|
||||
let regex = /^(?=( +|\t+))\1(?:\t| )/u;
|
||||
|
||||
lines.forEach((line, i) => {
|
||||
const match = regex.exec(line);
|
||||
if (smartTabs) {
|
||||
|
||||
if (match) {
|
||||
const lineNumber = i + 1;
|
||||
const loc = {
|
||||
start: {
|
||||
line: lineNumber,
|
||||
column: match[0].length - 2,
|
||||
},
|
||||
end: {
|
||||
line: lineNumber,
|
||||
column: match[0].length,
|
||||
},
|
||||
};
|
||||
/*
|
||||
* At least one space followed by a tab
|
||||
* before non-tab/-space characters begin.
|
||||
*/
|
||||
regex = /^(?=(\t*))\1(?=( +))\2\t/u;
|
||||
}
|
||||
|
||||
if (!ignoredCommentLines.has(lineNumber)) {
|
||||
const containingNode =
|
||||
sourceCode.getNodeByRangeIndex(
|
||||
sourceCode.getIndexFromLoc(loc.start),
|
||||
);
|
||||
lines.forEach((line, i) => {
|
||||
const match = regex.exec(line);
|
||||
|
||||
if (
|
||||
!(
|
||||
containingNode &&
|
||||
["Literal", "TemplateElement"].includes(
|
||||
containingNode.type,
|
||||
)
|
||||
)
|
||||
) {
|
||||
context.report({
|
||||
node,
|
||||
loc,
|
||||
messageId: "mixedSpacesAndTabs",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
if (match) {
|
||||
const lineNumber = i + 1;
|
||||
const loc = {
|
||||
start: {
|
||||
line: lineNumber,
|
||||
column: match[0].length - 2
|
||||
},
|
||||
end: {
|
||||
line: lineNumber,
|
||||
column: match[0].length
|
||||
}
|
||||
};
|
||||
|
||||
if (!ignoredCommentLines.has(lineNumber)) {
|
||||
const containingNode = sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(loc.start));
|
||||
|
||||
if (!(containingNode && ["Literal", "TemplateElement"].includes(containingNode.type))) {
|
||||
context.report({
|
||||
node,
|
||||
loc,
|
||||
messageId: "mixedSpacesAndTabs"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user