Hemadri Dasari
Hemadri Dasari

Reputation: 33974

How to run tslint.json?

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

Upvotes: 13

Views: 27364

Answers (1)

Quentin
Quentin

Reputation: 943185

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.

Upvotes: 14

Related Questions