首页 > 解决方案 > 将 Angular 11 项目转换为 eslint 后出错

问题描述

我按照Angular 的步骤将我们的代码库更新为 Eslint

除了现在我所有的 TS 文件在 VSCode 中都有这个错误:

Parsing error: Cannot read {file '/users/steve/github/myproject/tsconfig.json'.

与主要进口一致

在此处输入图像描述

项目结构是这样的(简化):

- package.json
- .eslintrc.json
- client
  - tsconfig.json
  - package.json
  - .eslintrc.json
  - angular.json
  - projects
    --someotherproject
  - src
    - app
      - [all of the main app's code]

当我运行时ng lint myproject,我会收到我希望看到的 eslint/prettier 警告。我仍然收到不推荐使用 tslint 并更新到 eslint 的提示。

我没有收到 tslint.config 错误,因为文件在那里。

标签: jsonangulareslinttslintprettier

解决方案


推荐阅读