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:
+7
-18
@@ -39,10 +39,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
import debugOrig from "debug";
|
||||
import fs from "node:fs";
|
||||
import fs from "fs";
|
||||
import importFresh from "import-fresh";
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { createRequire } from "module";
|
||||
import path from "path";
|
||||
import stripComments from "strip-json-comments";
|
||||
|
||||
import {
|
||||
@@ -254,7 +254,7 @@ function loadPackageJSONConfigFile(filePath) {
|
||||
try {
|
||||
const packageData = loadJSONConfigFile(filePath);
|
||||
|
||||
if (!Object.hasOwn(packageData, "eslintConfig")) {
|
||||
if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) {
|
||||
throw Object.assign(
|
||||
new Error("package.json file doesn't have 'eslintConfig' field."),
|
||||
{ code: "ESLINT_CONFIG_FIELD_NOT_FOUND" }
|
||||
@@ -273,7 +273,6 @@ function loadPackageJSONConfigFile(filePath) {
|
||||
* Loads a `.eslintignore` from a file.
|
||||
* @param {string} filePath The filename to load.
|
||||
* @returns {string[]} The ignore patterns from the file.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @private
|
||||
*/
|
||||
function loadESLintIgnoreFile(filePath) {
|
||||
@@ -346,7 +345,7 @@ function loadConfigFile(filePath) {
|
||||
function writeDebugLogForLoading(request, relativeTo, filePath) {
|
||||
/* istanbul ignore next */
|
||||
if (debug.enabled) {
|
||||
let nameAndVersion = null; // eslint-disable-line no-useless-assignment -- known bug in the rule
|
||||
let nameAndVersion = null;
|
||||
|
||||
try {
|
||||
const packageJsonPath = ModuleResolver.resolve(
|
||||
@@ -511,7 +510,6 @@ class ConfigArrayFactory {
|
||||
* @param {Object} [options] The options.
|
||||
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
|
||||
* @param {string} [options.name] The config name.
|
||||
* @throws {Error} If the config file is invalid.
|
||||
* @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
|
||||
*/
|
||||
loadInDirectory(directoryPath, { basePath, name } = {}) {
|
||||
@@ -597,7 +595,6 @@ class ConfigArrayFactory {
|
||||
/**
|
||||
* Load `.eslintignore` file in the current working directory.
|
||||
* @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
|
||||
* @throws {Error} If the ignore file is invalid.
|
||||
*/
|
||||
loadDefaultESLintIgnore() {
|
||||
const slots = internalSlotsMap.get(this);
|
||||
@@ -610,7 +607,7 @@ class ConfigArrayFactory {
|
||||
if (fs.existsSync(packageJsonPath)) {
|
||||
const data = loadJSONConfigFile(packageJsonPath);
|
||||
|
||||
if (Object.hasOwn(data, "eslintIgnore")) {
|
||||
if (Object.hasOwnProperty.call(data, "eslintIgnore")) {
|
||||
if (!Array.isArray(data.eslintIgnore)) {
|
||||
throw new Error("Package.json eslintIgnore property requires an array of paths");
|
||||
}
|
||||
@@ -799,7 +796,6 @@ class ConfigArrayFactory {
|
||||
* @param {string} extendName The name of a base config.
|
||||
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
|
||||
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
|
||||
* @throws {Error} If the extended config file can't be loaded.
|
||||
* @private
|
||||
*/
|
||||
_loadExtends(extendName, ctx) {
|
||||
@@ -823,7 +819,6 @@ class ConfigArrayFactory {
|
||||
* @param {string} extendName The name of a base config.
|
||||
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
|
||||
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
|
||||
* @throws {Error} If the extended config file can't be loaded.
|
||||
* @private
|
||||
*/
|
||||
_loadExtendedBuiltInConfig(extendName, ctx) {
|
||||
@@ -873,7 +868,6 @@ class ConfigArrayFactory {
|
||||
* @param {string} extendName The name of a base config.
|
||||
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
|
||||
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
|
||||
* @throws {Error} If the extended config file can't be loaded.
|
||||
* @private
|
||||
*/
|
||||
_loadExtendedPluginConfig(extendName, ctx) {
|
||||
@@ -911,7 +905,6 @@ class ConfigArrayFactory {
|
||||
* @param {string} extendName The name of a base config.
|
||||
* @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
|
||||
* @returns {IterableIterator<ConfigArrayElement>} The normalized config.
|
||||
* @throws {Error} If the extended config file can't be loaded.
|
||||
* @private
|
||||
*/
|
||||
_loadExtendedShareableConfig(extendName, ctx) {
|
||||
@@ -1155,8 +1148,4 @@ class ConfigArrayFactory {
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
ConfigArrayFactory,
|
||||
createContext,
|
||||
loadConfigFile
|
||||
};
|
||||
export { ConfigArrayFactory, createContext };
|
||||
|
||||
Reference in New Issue
Block a user