@angular-eslint/builder 15.0.0-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.
- package/dist/lint.impl.js +24 -1
- package/package.json +2 -2
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
|
-
|
|
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": "15.0.0-alpha.
|
|
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",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"eslint": "^7.20.0 || ^8.0.0",
|
|
23
23
|
"typescript": "*"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "58e6105c2375550f2b786406f25e304b0d59095b"
|
|
26
26
|
}
|