为什么“ npm install ”命令在安装Angular项目时警告“npm WARN deprecated tslint@6.1.3:”?

问题描述

为什么“ npm install ”命令在安装Angular项目时会警告“npm WARN deprecated tslint@6.1.3:”?

npm WARN deprecated tslint@6.1.3:TSLint 已被弃用而支持 ESLint。请参阅 https://github.com/palantir/tslint/issues/4534 了解更多信息。

解决方法

angular 使用 tslint,但正如您所提到的,它已被弃用。 angular 团队已经准备了很多,将在下一个版本中移除 tslint。 angular es lint 项目在第 1 版(最后几天发布)中存在,并且已经可以使用了。它们提供了迁移路径,以避免在更改过程中出现大问题。

,
npx tslint-to-eslint-config

tslint-to-eslint-config

tslint-to-eslint-config 命令读入任何现有的 linter、TypeScript 和包配置文件,然后基于它们创建 .eslintrc.js 结果。

对于任何具有相应 ESLint 等效项的 TSLint 规则,这些等效项将在新配置中使用。没有 ESLint 等效项的 TSLint 规则将用 eslint-plugin-tslint 包装。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...