简体   繁体   English

Nx Angular TSLint 到 ESLint 迁移后的 Lint 错误

[英]Nx Angular Lint Error after TSLint to ESLint Migration

I'm very new to Nx and today I tried to migrate all our Angular apps from TSLint to ESLint.我对Nx很陌生,今天我尝试将我们所有的 Angular 应用程序从 TSLint 迁移到 ESLint。 What I did was to run the following command for each app:我所做的是为每个应用程序运行以下命令:

nx g convert-tslint-to-eslint --project=SELECTED_PROJECT

After the migration I ran npm install and then npm run lint .迁移后,我运行npm install然后npm 运行 lint But each time I run the linter, I get the following error without any detailed information:但是每次运行 linter 时,我都会收到以下错误,但没有任何详细信息:

Cannot read properties of undefined (reading 'start')无法读取未定义的属性(读取“开始”)

The project specs:项目规格:

  • Angular v12.2.13 Angular v12.2.13
  • Nx v12.10.1 Nx v12.10.1

Any idea what might be wrong?知道可能出了什么问题吗?

I found the origin on the problem.我找到了问题的根源。 The issue is related with this ESLint rule:该问题与此 ESLint 规则有关:

"indent": [
      "error",
      4,
      {
        "SwitchCase": 1
      }
    ],

Have no idea why it's breaking with this rule.不知道为什么它违反了这条规则。 For now I removed it and using the overrides to apply this rule:现在我删除了它并使用覆盖来应用这个规则:

"@typescript-eslint/indent": [
          "error",
          4,
          {
            "FunctionDeclaration": {
              "parameters": "first"
            },
            "FunctionExpression": {
              "parameters": "first"
            }
          }
        ],

If anyone finds a better way to solve this issue, please let me know.如果有人找到解决此问题的更好方法,请告诉我。

暂无
暂无

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

相关问题 Tslint 到 Eslint 迁移 - convert-tslint-to-eslint 命令后出错 - Tslint to Eslint migration - Error after convert-tslint-to-eslint command 发生未处理的异常:无效的 lint 配置。 在 Angular 12 中将 Tslint 迁移到 eslint 后没有任何 lint - An unhandled exception occurred: invalid lint configuration. Nothing to lint after migrating Tslint to eslint in Angular 12 在Angular中用多个项目迁移TSLint到ESLint,ng lint命令挂起 - Migrate TSLint to ESLint in Angular with multiple projects, ng lint command hangs Tslint 到 ESLint 迁移错误:未知选项 '--remove-tslint-if-no-more-tslint-targets' - Tslint to ESLint Migration Error : unknown option '--remove-tslint-if-no-more-tslint-targets' 尝试对 Angular 模板进行 lint 时出现 ESLint 错误 - ESLint error when trying to lint Angular templates Angular 12 从 tslint 切换到 eslint 后模板 linting 不起作用 - Angular 12 template linting not working after switchting from tslint to eslint 将 angular 更新到 v14 后,TSlint 规则变为 ESlint - TSlint rules to ESlint after update angular to v14 出现 Angular Migrate TSLint to ESLint Banana-In-Box 错误 - Having Angular Migrate TSLint to ESLint Banana-In-Box Error 升级到 EsLint:angular.json 出错(原理图:convert-tslint-to-eslint) - Upgrading to EsLint: Error with angular.json (schematics:convert-tslint-to-eslint) 带有 Angular 7 和 `ng lint` 的 TypeScript 中的自定义 TSLint 规则 - Custom TSLint Rule in TypeScript with Angular 7 and `ng lint`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM