简体   繁体   English

升级到 EsLint:angular.json 出错(原理图:convert-tslint-to-eslint)

[英]Upgrading to EsLint: Error with angular.json (schematics:convert-tslint-to-eslint)

I wanted to upgrade my project to ESLint and was following this tutorial:我想将我的项目升级到 ESLint 并遵循本教程:

https://blog.ninja-squad.com/2021/03/31/migrating-from-tslint-to-eslint/ https://blog.ninja-squad.com/2021/03/31/migrating-from-tslint-to-eslint/

I did the first command, ng add @angular-eslint/schematics , which worked.我做了第一个命令, ng add @angular-eslint/schematics ,它起作用了。 But then, after executing ng g @angular-eslint/schematics:convert-tslint-to-eslint your_project_name I got the following error:但是,在执行ng g @angular-eslint/schematics:convert-tslint-to-eslint your_project_name之后,出现以下错误: 在此处输入图像描述

I looked at this post already: How to run @angular-eslint/schematics:convert-tslint-to-eslint , but nothing about it helped.我已经看过这篇文章: 如何运行 @angular-eslint/schematics:convert-tslint-to-eslint ,但没有任何帮助。

This seems like an easy error to google but either I searched incorrectly or this really is some unusual problem.这对谷歌来说似乎是一个简单的错误,但要么我搜索不正确,要么这确实是一些不寻常的问题。 Obviously, I cannot delete the angular.json file.显然,我无法删除 angular.json 文件。 What might cause this?什么可能导致这种情况?

My TsLint version: 6.1.0我的 TsLint 版本:6.1.0

My Angular version: 12.0.2我的 Angular 版本:12.0.2

Note that I upgraded to Angular 12 a week ago, before it was Angular 11.请注意,我在一周前升级到 Angular 12,之前是 Angular 11。

I tried the same upgrade in my project and added我在我的项目中尝试了相同的升级并添加了

  "cli": {
    "analytics": false,
    "defaultCollection": "@angular-eslint/schematics"
  },

in my angular.json manually.手动在我的 angular.json 中。 After this I could continue with no errors.在此之后,我可以继续没有错误。

You should run this command from your root of your project (without the name of the project like you did)您应该从项目的根目录运行此命令(没有您所做的项目名称)

ng g @angular-eslint/schematics:convert-tslint-to-eslint

I suggest to consider using this walkthrough instead https://www.bitovi.com/blog/angular-upgrades-painless-migration-from-tslint-to-eslint since it seems clearer from my point of view.我建议考虑使用此演练代替https://www.bitovi.com/blog/angular-upgrades-painless-migration-from-tslint-to-eslint ,因为从我的角度来看,它似乎更清晰。

暂无
暂无

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

相关问题 如何运行@angular-eslint/schematics:convert-tslint-to-eslint - How to run @angular-eslint/schematics:convert-tslint-to-eslint Tslint 到 Eslint 迁移 - convert-tslint-to-eslint 命令后出错 - Tslint to Eslint migration - Error after convert-tslint-to-eslint command 如何添加@angular-eslint/schematics? 错误 - How add @angular-eslint/schematics? Error “TSLint 仍然存在”=&gt; 从 TSlint 升级到 ESLint - “TSLint still there” => upgrading from TSlint to ESLint 不支持:关键字“id”,使用“$id”作为模式 ID:TSLint(ng add @angular-eslint/schematics) - NOT SUPPORTED: keyword "id", use "$id" for schema ID : TSLint (ng add @angular-eslint/schematics) 将 tslint 迁移到 @angular-eslint/schematics:ERESOLVE 无法解析依赖树:@angular/compiler@12.1.2 - Migrate tslint to @angular-eslint/schematics: ERESOLVE unable to resolve dependency tree: @angular/compiler@12.1.2 出现 Angular Migrate TSLint to ESLint Banana-In-Box 错误 - Having Angular Migrate TSLint to ESLint Banana-In-Box Error Nx Angular TSLint 到 ESLint 迁移后的 Lint 错误 - Nx Angular Lint Error after TSLint to ESLint Migration 升级到 Angular 13 时从 @angular-eslint/schematics@12.6.1 接收对等 @angular/cli@&quot;&gt;= 12.0.0 &lt; 13.0.0&quot; - Receiving peer @angular/cli@">= 12.0.0 < 13.0.0" from @angular-eslint/schematics@12.6.1 when upgrading to Angular 13 Angular Schematics,修改angular.json的代码并没有结合在一起 - Angular Schematics, code to modify angular.json is not coming together
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM