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:
+20
-16
@@ -9,11 +9,11 @@
|
||||
// Requirements
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
const { ESLint, shouldUseFlatConfig } = require("./eslint/eslint");
|
||||
const { LegacyESLint } = require("./eslint/legacy-eslint");
|
||||
const { ESLint, FlatESLint } = require("./eslint");
|
||||
const { shouldUseFlatConfig } = require("./eslint/flat-eslint");
|
||||
const { Linter } = require("./linter");
|
||||
const { RuleTester } = require("./rule-tester");
|
||||
const { SourceCode } = require("./languages/js/source-code");
|
||||
const { SourceCode } = require("./source-code");
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Functions
|
||||
@@ -23,18 +23,22 @@ const { SourceCode } = require("./languages/js/source-code");
|
||||
* Loads the correct ESLint constructor given the options.
|
||||
* @param {Object} [options] The options object
|
||||
* @param {boolean} [options.useFlatConfig] Whether or not to use a flat config
|
||||
* @param {string} [options.cwd] The current working directory
|
||||
* @returns {Promise<ESLint|LegacyESLint>} The ESLint constructor
|
||||
*/
|
||||
async function loadESLint({ useFlatConfig } = {}) {
|
||||
/*
|
||||
* Note: The v8.x version of this function also accepted a `cwd` option, but
|
||||
* it is not used in this implementation so we silently ignore it.
|
||||
*/
|
||||
async function loadESLint({ useFlatConfig, cwd = process.cwd() } = {}) {
|
||||
|
||||
const shouldESLintUseFlatConfig =
|
||||
useFlatConfig ?? (await shouldUseFlatConfig());
|
||||
/*
|
||||
* Note: The v9.x version of this function doesn't have a cwd option
|
||||
* because it's not used. It's only used in the v8.x version of this
|
||||
* function.
|
||||
*/
|
||||
|
||||
return shouldESLintUseFlatConfig ? ESLint : LegacyESLint;
|
||||
const shouldESLintUseFlatConfig = typeof useFlatConfig === "boolean"
|
||||
? useFlatConfig
|
||||
: await shouldUseFlatConfig({ cwd });
|
||||
|
||||
return shouldESLintUseFlatConfig ? FlatESLint : ESLint;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -42,9 +46,9 @@ async function loadESLint({ useFlatConfig } = {}) {
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
module.exports = {
|
||||
Linter,
|
||||
loadESLint,
|
||||
ESLint,
|
||||
RuleTester,
|
||||
SourceCode,
|
||||
Linter,
|
||||
loadESLint,
|
||||
ESLint,
|
||||
RuleTester,
|
||||
SourceCode
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user