javascript - 如何运行 tslint.json?

标签 javascript node.js typescript tslint

我是 typescript 的新手。我创建了 tslint.json 文件,但不知道如何使用命令行运行此文件。请告知我需要使用哪个命令来运行此配置

最佳答案

tslint.json 是 TSLint 配置文件。它需要全局 tslint 安装:

npm i -g tslint

在这个 TSLint 中可以从命令行作为 tslint

执行

或者本地安装:

npm i tslint

在这种情况下,应该在 package.json 脚本中指定 tslint:

"scripts": { "lint": "tslint" }

并作为 npm run lint 执行。

正如 tslint --help 所说,它接受以下命令行选项:

-c, --config:
    The location of the configuration file that tslint will use to
    determine which rules are activated and what options to provide
    to the rules. If no option is specified, the config file named
    tslint.json is used, so long as it exists in the path.

tslint.json 将默认使用现有文件结构。

关于javascript - 如何运行 tslint.json?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52575553/

相关文章:

node.js - VSCode 的 launch.json 中的 args 和 runtimeArgs 有什么区别?

typescript - 我可以将 TypeScript 类型与 io-ts 一起使用吗?

javascript - 在脚本执行之间添加延迟,尤其是在 FOR 循环中

javascript - 如何知道递归的异步任务何时完成

node.js https没有响应 'end'事件, 'close'代替?

node.js - 如何使用 NodeJs aws-sdk 更改电子邮件发件人姓名

javascript - Jquery提交表单不起作用

javascript - 如果我有线性渐变,则更改滚动上的颜色背景

angular - 使用 mdIcon 时从控制台获取错误

函数类型和参数类型映射之间的 typescript 匹配