what is the difference between setting rules in tsconfig.json vs tslint.json?

TSConfig : Deals with the compiler. Throws an error on compiling bad code. So in Anguar "ng serve" will give you an error Ex Error => error TS6138: Property 'dialog' is declared but its value is never read.

TsLint : Its to ensure best practice is followed. It does not throw an error on compilation. However, it shows a red line on the code to tell you that your style of coding needs some changes. On VScode , you need to install a plugin to detect tslint. On webstorm , it is inbuilt


tsconfig.json receives the configuration for the typescript compiler like allowing javascript files, the location of your files, etc.

tslint.json is the configuration for TSLint, TSLint helps you to detect bad coding practices or follow a coding style, you can configure its options like disallow unused variables, no logging to the console, etc. Also, TSLint is not just a plugin for vscode, so someone in your team can use the editor of its preference and still use TSLint.

See this links:

  • tsconfig.json
  • tslint.json

Tags:

Typescript