@angular-eslint/builder 14.3.1-alpha.0 → 15.0.0-alpha.1

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.
Files changed (2) hide show
  1. package/dist/lint.impl.js +24 -1
  2. package/package.json +3 -3
package/dist/lint.impl.js CHANGED
@@ -32,7 +32,30 @@ exports.default = (0, architect_1.createBuilder)(async (options, context) => {
32
32
  const eslintConfigPath = options.eslintConfig
33
33
  ? (0, path_1.resolve)(workspaceRoot, options.eslintConfig)
34
34
  : undefined;
35
- const lintResults = await (0, eslint_utils_1.lint)(workspaceRoot, eslintConfigPath, options);
35
+ let lintResults = [];
36
+ try {
37
+ lintResults = await (0, eslint_utils_1.lint)(workspaceRoot, eslintConfigPath, options);
38
+ }
39
+ catch (err) {
40
+ if (err instanceof Error &&
41
+ err.message.includes('You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser')) {
42
+ let eslintConfigPathForError = `for ${projectName}`;
43
+ const projectMetadata = await context.getProjectMetadata(projectName);
44
+ if (projectMetadata) {
45
+ eslintConfigPathForError = `\`${projectMetadata.root}/.eslintrc.json\``;
46
+ }
47
+ console.error(`
48
+ Error: You have attempted to use a lint rule which requires the full TypeScript type-checker to be available, but you do not have \`parserOptions.project\` configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your ESLint config ${eslintConfigPath || eslintConfigPathForError}
49
+
50
+ For full guidance on how to resolve this issue, please see https://github.com/angular-eslint/angular-eslint/blob/main/docs/RULES_REQUIRING_TYPE_INFORMATION.md
51
+ `);
52
+ return {
53
+ success: false,
54
+ };
55
+ }
56
+ // If some unexpected error, rethrow
57
+ throw err;
58
+ }
36
59
  if (lintResults.length === 0) {
37
60
  throw new Error('Invalid lint configuration. Nothing to lint.');
38
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/builder",
3
- "version": "14.3.1-alpha.0+f71f236",
3
+ "version": "15.0.0-alpha.1",
4
4
  "description": "Angular CLI builder for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "builders": "./builders.json",
21
21
  "peerDependencies": {
22
- "eslint": "^7.0.0 || ^8.0.0",
22
+ "eslint": "^7.20.0 || ^8.0.0",
23
23
  "typescript": "*"
24
24
  },
25
- "gitHead": "f71f23652a74ebd2f650baeb3a91051db554c5d9"
25
+ "gitHead": "58e6105c2375550f2b786406f25e304b0d59095b"
26
26
  }