最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to run tslint.json? - Stack Overflow

programmeradmin0浏览0评论

I am newbie to typescript. I have tslint.json file created but don't have an idea about how to run this file using command line. Please advise which command do I need to use to run this config

I am newbie to typescript. I have tslint.json file created but don't have an idea about how to run this file using command line. Please advise which command do I need to use to run this config

Share Improve this question asked Sep 30, 2018 at 7:15 Hemadri DasariHemadri Dasari 34k40 gold badges124 silver badges165 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 14

tslint.json is TSLint configuration file. It requires either global tslint installation:

npm i -g tslint

In this TSLint can be executed from command line as tslint

Or local installation:

npm i tslint

In this case tslint should be specified in package.json scripts:

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

And be executed as npm run lint.

As tslint --help says, it accepts the following commandline options:

-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 from existing file structure will be used by default.

发布评论

评论列表(0)

  1. 暂无评论