@angular-eslint/builder
Advanced tools
Comparing version 18.3.2-alpha.13 to 18.3.2-alpha.14
@@ -31,5 +31,5 @@ "use strict"; | ||
* we only want to support it if the user has explicitly opted into it by converting | ||
* their root ESLint config to use eslint.config.js | ||
* their root ESLint config to use a supported flat config file name. | ||
*/ | ||
const useFlatConfig = (0, fs_1.existsSync)((0, path_1.join)(systemRoot, 'eslint.config.js')); | ||
const useFlatConfig = eslint_utils_1.supportedFlatConfigNames.some((name) => (0, fs_1.existsSync)((0, path_1.join)(systemRoot, name))); | ||
const { eslint, ESLint } = await (0, eslint_utils_1.resolveAndInstantiateESLint)(eslintConfigPath, options, useFlatConfig); | ||
@@ -36,0 +36,0 @@ const version = ESLint?.version?.split('.'); |
import type { ESLint } from 'eslint'; | ||
import type { Schema } from '../schema'; | ||
export declare const supportedFlatConfigNames: string[]; | ||
export declare function resolveAndInstantiateESLint(eslintConfigPath: string | undefined, options: Schema, useFlatConfig?: boolean): Promise<{ | ||
@@ -4,0 +5,0 @@ ESLint: typeof import("eslint").ESLint; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.supportedFlatConfigNames = void 0; | ||
exports.resolveAndInstantiateESLint = resolveAndInstantiateESLint; | ||
exports.supportedFlatConfigNames = [ | ||
'eslint.config.js', | ||
'eslint.config.mjs', | ||
'eslint.config.cjs', | ||
]; | ||
async function resolveESLintClass(useFlatConfig = false) { | ||
@@ -26,4 +32,4 @@ try { | ||
eslintConfigPath && | ||
!eslintConfigPath?.endsWith('eslint.config.js')) { | ||
throw new Error('When using the new Flat Config with ESLint, all configs must be named eslint.config.js and .eslintrc files may not be used. See https://eslint.org/docs/latest/use/configure/configuration-files-new'); | ||
!exports.supportedFlatConfigNames.some((name) => eslintConfigPath.endsWith(name))) { | ||
throw new Error(`When using the new Flat Config with ESLint, all configs must be named ${exports.supportedFlatConfigNames.join(' or ')}, and .eslintrc files may not be used. See https://eslint.org/docs/latest/use/configure/configuration-files`); | ||
} | ||
@@ -30,0 +36,0 @@ const ESLint = await resolveESLintClass(useFlatConfig); |
{ | ||
"name": "@angular-eslint/builder", | ||
"version": "18.3.2-alpha.13", | ||
"version": "18.3.2-alpha.14", | ||
"description": "Angular CLI builder for ESLint", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18433
367