javascript ESLint:“parserOptions.project”未配置为指向项目tsconfig.json文件

inn6fuwd  于 2023-02-28  发布在  Java
关注(0)|答案(1)|浏览(222)

在我的NX工作区中,我有一个NestJS-Angular项目。当我运行nx lint时,我得到以下错误:

Error: You have attempted to use a lint rule which requires the full TypeScript type-checker to be available, but you do not have `parserOptions.project` configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your project ESLint config `apps/client/.eslintrc.json`

Please see https://nx.dev/guides/eslint for full guidance on how to resolve this issue.

我已经浏览了上面提到的链接,正如你所看到的,我已经在我的.eslintrc.json文件中添加了parserOptions.project,但是错误仍然存在。

{
  "extends": ["../../.eslintrc.json"],
  "ignorePatterns": ["!**/*"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parserOptions": {
        "project": ["/apps/client/tsconfig.*?.json"]
      },
      "extends": [
        "plugin:@nrwl/nx/angular",
        "plugin:@angular-eslint/template/process-inline-templates"
      ],
      "rules": {
        "@angular-eslint/directive-selector": [
          "error",
          {
            "type": "attribute",
            "prefix": "learning",
            "style": "camelCase"
          }
        ],
        "@angular-eslint/component-selector": [
          "error",
          {
            "type": "element",
            "prefix": "learning",
            "style": "kebab-case"
          }
        ],
        "no-empty-function": "off",
        "@typescript-eslint/no-empty-function": "off",
        "@angular-eslint/no-empty-lifecycle-method": "off"
      }
    },
    {
      "files": ["*.html"],
      "extends": ["plugin:@nrwl/nx/angular-template"],
      "rules": {}
    }
  ]
}

任何帮助都将不胜感激。

wgxvkvu9

wgxvkvu91#

删除应用程序/客户端中解析器Options.project中的斜线

相关问题