I am using AngularJs project and the requirement is to use tslint to treat warnings as errors.
I have went through the palantir website (https://palantir.github.io/tslint/usage/cli/) and follow all the steps to install the tslint like below:
npm install tslint typescript --save-dev
-i, --init:
- Generates a tslint.json config file in the current working directory.
I can see the tslint.json file in my project directory, now I am stuck here.The rules are not reflecting, not sure if I am doing correct things to run tslint on project files.
I need little guidance here to understand:
- How to run tslint to check if rules are running perfectly.
- Is it automatically runs in background or is there any command to run tslilnt rules?
- How can I set rule to treat warnings as errors for all the js files in the project?
Can anyone explains the steps to follow to implement tslint in AngularJS project using VSCode, please?
I am using Visual Studio Code to develop the application.
My tslint.json looks like below:
{
"defaultSeverity": "error",
"complierOptions":{
"allowJs":true
},
"jsRules": {
"no-invalid-this": false,
"severity": "error",
"max-line-length": {
"options": [120]
}
},
"rules": {
"severity": "error"
},
"rulesDirectory": []
}
I have alrady try to refer some of the links but no luck.
one of then is -TSLint configuration for Angular 1 project
Thanks in Advance