Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 459
Hemadri Dasari Avatar asked Sep 30 '18 07:09

Hemadri Dasari


People also ask

How do I test my Tslint?

--type-check: (deprecated) Checks for type errors before linting a project. --project must be specified in order to enable type checking. -v, --version: The current version of tslint. -h, --help: Prints this help message.

What is Tslint json file?

TSLint Configuration. When using the CLI or many third-party tools, a file named tslint. json or tslint. yaml is used to configure which rules get run and each of their options.

Where is Tslint json located?

By default, GoLand uses the TSLint package from the project node_modules folder and the tslint. json configuration file from the folder where the current file is stored. If no tslint. json is found in the current file folder, GoLand will look for one in its parent folders up to the project root.


1 Answers

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.

like image 126
2 revs, 2 users 63% Avatar answered Sep 29 '22 11:09

2 revs, 2 users 63%