@angular-eslint/builder 18.3.2-alpha.13 → 18.3.2-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lint.impl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.impl.d.ts","sourceRoot":"","sources":["../src/lint.impl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;;
|
|
1
|
+
{"version":3,"file":"lint.impl.d.ts","sourceRoot":"","sources":["../src/lint.impl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;;AAMvC,wBAkME"}
|
package/dist/lint.impl.js
CHANGED
|
@@ -28,9 +28,9 @@ exports.default = (0, architect_1.createBuilder)(async (options, context) => {
|
|
|
28
28
|
/**
|
|
29
29
|
* Until ESLint v9 is released and the new so called flat config is the default
|
|
30
30
|
* we only want to support it if the user has explicitly opted into it by converting
|
|
31
|
-
* their root ESLint config to use
|
|
31
|
+
* their root ESLint config to use a supported flat config file name.
|
|
32
32
|
*/
|
|
33
|
-
const useFlatConfig = (0, fs_1.existsSync)((0, path_1.join)(systemRoot,
|
|
33
|
+
const useFlatConfig = eslint_utils_1.supportedFlatConfigNames.some((name) => (0, fs_1.existsSync)((0, path_1.join)(systemRoot, name)));
|
|
34
34
|
const { eslint, ESLint } = await (0, eslint_utils_1.resolveAndInstantiateESLint)(eslintConfigPath, options, useFlatConfig);
|
|
35
35
|
const version = ESLint?.version?.split('.');
|
|
36
36
|
if (!version ||
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ESLint } from 'eslint';
|
|
2
2
|
import type { Schema } from '../schema';
|
|
3
|
+
export declare const supportedFlatConfigNames: string[];
|
|
3
4
|
export declare function resolveAndInstantiateESLint(eslintConfigPath: string | undefined, options: Schema, useFlatConfig?: boolean): Promise<{
|
|
4
5
|
ESLint: typeof import("eslint").ESLint;
|
|
5
6
|
eslint: ESLint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../src/utils/eslint-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../src/utils/eslint-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,eAAO,MAAM,wBAAwB,UAIpC,CAAC;AAuBF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GA0EtB"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supportedFlatConfigNames = void 0;
|
|
3
4
|
exports.resolveAndInstantiateESLint = resolveAndInstantiateESLint;
|
|
5
|
+
exports.supportedFlatConfigNames = [
|
|
6
|
+
'eslint.config.js',
|
|
7
|
+
'eslint.config.mjs',
|
|
8
|
+
'eslint.config.cjs',
|
|
9
|
+
];
|
|
4
10
|
async function resolveESLintClass(useFlatConfig = false) {
|
|
5
11
|
try {
|
|
6
12
|
// In eslint 8.57.0 (the final v8 version), a dedicated API was added for resolving the correct ESLint class.
|
|
@@ -23,8 +29,8 @@ async function resolveESLintClass(useFlatConfig = false) {
|
|
|
23
29
|
async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatConfig = false) {
|
|
24
30
|
if (useFlatConfig &&
|
|
25
31
|
eslintConfigPath &&
|
|
26
|
-
!eslintConfigPath
|
|
27
|
-
throw new Error(
|
|
32
|
+
!exports.supportedFlatConfigNames.some((name) => eslintConfigPath.endsWith(name))) {
|
|
33
|
+
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`);
|
|
28
34
|
}
|
|
29
35
|
const ESLint = await resolveESLintClass(useFlatConfig);
|
|
30
36
|
const eslintOptions = {
|