@angular-eslint/builder 18.2.1-alpha.6 → 18.2.1-alpha.7

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.
@@ -1,3 +1,4 @@
1
- declare const _default: any;
1
+ import type { Schema } from './schema';
2
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<Schema & import("@angular-devkit/core").JsonObject>;
2
3
  export default _default;
3
4
  //# sourceMappingURL=lint.impl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint.impl.d.ts","sourceRoot":"","sources":["../src/lint.impl.ts"],"names":[],"mappings":";AAYA,wBAgME"}
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;;AAGvC,wBA+LE"}
package/dist/lint.impl.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
3
+ const architect_1 = require("@angular-devkit/architect");
4
4
  const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  const eslint_utils_1 = require("./utils/eslint-utils");
7
- exports.default = (0, devkit_1.convertNxExecutor)(async (options, context) => {
8
- const systemRoot = context.root;
7
+ exports.default = (0, architect_1.createBuilder)(async (options, context) => {
8
+ const systemRoot = context.workspaceRoot;
9
9
  // eslint resolves files relative to the current working directory.
10
10
  // We want these paths to always be resolved relative to the workspace
11
11
  // root to be able to run the lint executor from any subfolder.
12
12
  process.chdir(systemRoot);
13
- const projectName = context.projectName || '<???>';
13
+ const projectName = context.target?.project ?? '<???>';
14
14
  const printInfo = options.format && !options.silent;
15
15
  if (printInfo) {
16
16
  console.info(`\nLinting ${JSON.stringify(projectName)}...`);
@@ -30,7 +30,7 @@ exports.default = (0, devkit_1.convertNxExecutor)(async (options, context) => {
30
30
  * we only want to support it if the user has explicitly opted into it by converting
31
31
  * their root ESLint config to use eslint.config.js
32
32
  */
33
- const useFlatConfig = (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, 'eslint.config.js'));
33
+ const useFlatConfig = (0, fs_1.existsSync)((0, path_1.join)(systemRoot, 'eslint.config.js'));
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 ||
@@ -47,8 +47,9 @@ exports.default = (0, devkit_1.convertNxExecutor)(async (options, context) => {
47
47
  if (err instanceof Error &&
48
48
  err.message.includes('You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser')) {
49
49
  let eslintConfigPathForError = `for ${projectName}`;
50
- if (context.projectsConfigurations?.projects?.[projectName]?.root) {
51
- const { root } = context.projectsConfigurations.projects[projectName];
50
+ const projectMetadata = await context.getProjectMetadata(projectName);
51
+ if (projectMetadata?.root) {
52
+ const { root } = projectMetadata;
52
53
  eslintConfigPathForError = `\`${root}/.eslintrc.json\``;
53
54
  }
54
55
  console.error(`
@@ -111,7 +112,7 @@ For full guidance on how to resolve this issue, please see https://github.com/an
111
112
  */
112
113
  const formattedResults = await formatter.format(finalLintResults);
113
114
  if (options.outputFile) {
114
- const pathToOutputFile = (0, path_1.join)(context.root, options.outputFile);
115
+ const pathToOutputFile = (0, path_1.join)(systemRoot, options.outputFile);
115
116
  (0, fs_1.mkdirSync)((0, path_1.dirname)(pathToOutputFile), { recursive: true });
116
117
  (0, fs_1.writeFileSync)(pathToOutputFile, formattedResults);
117
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/builder",
3
- "version": "18.2.1-alpha.6",
3
+ "version": "18.2.1-alpha.7",
4
4
  "description": "Angular CLI builder for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -18,10 +18,6 @@
18
18
  "LICENSE",
19
19
  "builders.json"
20
20
  ],
21
- "dependencies": {
22
- "@nx/devkit": ">= 19.5.4 < 20.0.0",
23
- "nx": ">= 19.5.4 < 20.0.0"
24
- },
25
21
  "devDependencies": {
26
22
  "@angular-devkit/architect": ">= 0.1800.0 < 0.1900.0",
27
23
  "@angular-devkit/core": ">= 18.0.0 < 19.0.0"