如何运行tslint.json?

How to run tslint.json?

我是打字稿的新手。我创建了 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