简体   繁体   English

使用 angular 10 排除 LINT 中的参考库项目文件夹

[英]Exclude the reference library project folder in LINT with angular 10

I am trying to exclude the reference library project files while running the command npm run lint , but it is not working for me.我试图在运行命令npm run lint时排除参考库项目文件,但它对我不起作用。

In the main application, I have added these code in the angular.json在主应用程序中,我在 angular.json 中添加了这些代码

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/**"
            ]
          }
        }

I have the below file structure and trying to exclude the files inside API and MODEL folder我有以下文件结构并试图排除 API 和 MODEL 文件夹中的文件

在此处输入图片说明

Followed the instruction from below按照下面的说明进行操作

How to exclude all files under a directory in lint using angular CLI? 如何使用angular CLI排除lint目录下的所有文件?

This help me这对我有帮助

From tslint v5.8.0 you can now ignore files from your tslint.json file.从 tslint v5.8.0 开始,您现在可以忽略 tslint.json 文件中的文件。 Just add this to your toplevel tslint.json file:只需将此添加到您的顶级 tslint.json 文件中:

     "linterOptions": {
    "exclude": ["projects/ors-testtaker-bff/api/**/*","projects/ors-testtaker-bff/model/**/*"]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM