Issue
My project is written in Angular 13 and Typescript and with eslint
. Later on I've added Cypress. And when I run command ng lint
it doesn't check files inside /cypress
folder. But when I use Visual Studio Code it correctly finds errors.
.eslintrc.json
{
"root": true,
"ignorePatterns": [
"projects/**/*",
"cypress/fixtures/**/*",
"cypress/integration-original/**/*.js",
"src/**/*.spec.ts",
"src/**/*.mock.ts"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"eslint:recommended",
"plugin:@angular-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"deprecation"
],
"rules": { ... }
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
In Angular project, folder structure is:
-cypress
-node_modules
-src
.eslintrc.json
tsconfig.json
...
Solution
I've added in angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"projects": {
"my-app": {
"architect": {
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html",
"cypress"
]
}
}
}
}
},
}
Answered By - koral
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.