【问题标题】:Exclude the reference library project folder in LINT with angular 10使用角度 10 排除 LINT 中的参考库项目文件夹
【发布时间】:2020-09-17 03:41:20
【问题描述】:

我在运行命令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?

【问题讨论】:

    标签: javascript angular typescript lint angular10


    【解决方案1】:

    这对我有帮助

    从 tslint v5.8.0 开始,您现在可以忽略 tslint.json 文件中的文件。只需将其添加到您的顶级 tslint.json 文件中:

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

    【讨论】:

      猜你喜欢
      • 2018-07-30
      • 1970-01-01
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多