Issue
After changing my project structure to a monorepo structure in Angular according to this tutorial, I encountered numerous config bugs that I managed to squash after lots of troubleshooting.
The full error reads
Cannot find "lint" target for the specified project.
You should add a package that implements linting capabilities
A variation of this error reads
Schema validation failed with the following errors:
Data path "" must have required property 'lintFilePatterns'.
Both errors can be fixed with proper configuration of your angular.json
.
Find the details to the fix below
Solution
Go to angular.json -> <your-projects-root-directory> -> <your-project-name> -> architect
and add or modify
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"<your-projects-root-directory>/<your-project-name>/src/**/*.ts",
"<your-projects-root-directory>/<your-project-name>/src/**/*.html"
]
}
},
This tells the ng lint command which linter to use in the respective project (builder) and which files to lint (lintFilePatterns).
Typically your project root directory is named projects
.
You might have to replace the "builder"
property by another linter, if you use tslint for example. See your package.json
for details.
Remember to set this for all your projects that are defined in angular.json
.
Answered By - BingeCode
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.