我是 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/