@angular-eslint/builder 17.3.1-alpha.2 → 17.3.1-alpha.3

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.js CHANGED
@@ -5,7 +5,6 @@ const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  const eslint_utils_1 = require("./utils/eslint-utils");
7
7
  exports.default = (0, devkit_1.convertNxExecutor)(async (options, context) => {
8
- var _a, _b, _c, _d;
9
8
  const systemRoot = context.root;
10
9
  // eslint resolves files relative to the current working directory.
11
10
  // We want these paths to always be resolved relative to the workspace
@@ -33,7 +32,7 @@ exports.default = (0, devkit_1.convertNxExecutor)(async (options, context) => {
33
32
  */
34
33
  const useFlatConfig = (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, 'eslint.config.js'));
35
34
  const { eslint, ESLint } = await (0, eslint_utils_1.resolveAndInstantiateESLint)(eslintConfigPath, options, useFlatConfig);
36
- const version = (_a = ESLint === null || ESLint === void 0 ? void 0 : ESLint.version) === null || _a === void 0 ? void 0 : _a.split('.');
35
+ const version = ESLint?.version?.split('.');
37
36
  if (!version ||
38
37
  version.length < 2 ||
39
38
  Number(version[0]) < 7 ||
@@ -48,7 +47,7 @@ exports.default = (0, devkit_1.convertNxExecutor)(async (options, context) => {
48
47
  if (err instanceof Error &&
49
48
  err.message.includes('You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser')) {
50
49
  let eslintConfigPathForError = `for ${projectName}`;
51
- if ((_d = (_c = (_b = context.projectsConfigurations) === null || _b === void 0 ? void 0 : _b.projects) === null || _c === void 0 ? void 0 : _c[projectName]) === null || _d === void 0 ? void 0 : _d.root) {
50
+ if (context.projectsConfigurations?.projects?.[projectName]?.root) {
52
51
  const { root } = context.projectsConfigurations.projects[projectName];
53
52
  eslintConfigPathForError = `\`${root}/.eslintrc.json\``;
54
53
  }
@@ -10,14 +10,14 @@ async function resolveESLintClass(useFlatConfig = false) {
10
10
  const { FlatESLint } = require('eslint/use-at-your-own-risk');
11
11
  return FlatESLint;
12
12
  }
13
- catch (_a) {
13
+ catch {
14
14
  throw new Error('Unable to find ESLint. Ensure ESLint is installed.');
15
15
  }
16
16
  }
17
17
  async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatConfig = false) {
18
18
  if (useFlatConfig &&
19
19
  eslintConfigPath &&
20
- !(eslintConfigPath === null || eslintConfigPath === void 0 ? void 0 : eslintConfigPath.endsWith('eslint.config.js'))) {
20
+ !eslintConfigPath?.endsWith('eslint.config.js')) {
21
21
  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');
22
22
  }
23
23
  const ESLint = await resolveESLintClass(useFlatConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/builder",
3
- "version": "17.3.1-alpha.2",
3
+ "version": "17.3.1-alpha.3",
4
4
  "description": "Angular CLI builder for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",