我的项目是用Angular 13和Typescript编写的,使用eslint
。后来我添加了Cypress。当我运行命令ng lint
时,它不会检查/cypress
文件夹中的文件。但当我使用Visual Studio代码时,它会正确地找到错误。
.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": {}
}
]
}
在Angular项目中,文件夹结构为:
-cypress
-node_modules
-src
.eslintrc.json
tsconfig.json
...
1条答案
按热度按时间rqqzpn5f1#
我添加了
angular.json