angular - eslint parseroptions.project 是做什么的?

标签 angular eslint tslint eslintrc nrwl

将我的 Angular 12 项目从 TSLint 迁移到 ESLint 后,为每个项目创建了一个 eslintrc 文件,每个文件都有一行将 parseroptions.projects 设置为这样的路由:

{
  "extends": ["../../.eslintrc.json"],
  "ignorePatterns": ["!**/*"],
  "overrides": [
    {     
      "parserOptions": {
        "project": ["apps/my-app/tsconfig.*?.json"]
      },
    ...
    ],
    ...
}

我一直在阅读 eslint 文档试图找到这个问题的答案,但没有找到任何有用的东西。

最佳答案

这是 @typescript-eslint 插件公开的一个附加配置选项。如果要使用需要类型信息的 eslint 规则,则此选项是必需的

参见 https://www.npmjs.com/package/@typescript-eslint/parser了解更多信息(搜索 parserOptions.project)。

关于angular - eslint parseroptions.project 是做什么的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68121642/

相关文章:

angular - 如何解决 rxjs Typescript 错误(Ionic 3、angularfire2)

angular - 无法实例化循环依赖! AuthService ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1

javascript - 在 Angular 6 中建立条件形式模型的惯用方法

javascript - eslint 规则强制变量在 block 的顶部声明?

javascript - TSLint ESLint - 当函数作为属性访问时发出警告?

angular - 失败 : Expected one matching operation for criteria "Match DocumentNode", 找不到

javascript - 我的配置中哪些 eslint 规则很慢?

typescript - 在 Typescript 中使用导入时如何处理 Tslint 错误超过 100 个字符

angular - ng test 要求我在运行任何单元测试之前修复所有 linting

node.js - 在 TypeScript 中,如何使用 (a : type, b :type): any?