问题描述
我正在尝试运行命令npm run lint
时排除参考库项目文件,但是它对我不起作用。
在主应用程序中,我已将这些代码添加到angular.json
Angular.json
"lint": {
"builder": "@angular-devkit/build-angular:tslint","options": {
"tsConfig": [
"projects/pts-ngx/core/tsconfig.lib.json","projects/pts-ngx/core/tsconfig.spec.json"
],"exclude": [
"**/node_modules/**","**/projects/ors-testtaker-bff/**"
]
}
}
我具有以下文件结构,并尝试排除API和MODEL文件夹中的文件
按照下面的说明
How to exclude all files under a directory in lint using angular CLI?
解决方法
这对我有帮助
现在从tslint v5.8.0开始,您可以忽略tslint.json文件中的文件。只需将其添加到您的顶级tslint.json文件中即可:
"linterOptions": {
"exclude": ["projects/ors-testtaker-bff/api/**/*","projects/ors-testtaker-bff/model/**/*"]
}