Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect unused variables in Typescript?

Is there a way to detect unused variables in Typescript (something like ESLint in Javascript)?

like image 293
Damian Pavlica Avatar asked May 25 '16 15:05

Damian Pavlica


1 Answers

As of version 2.0, Typescript has built-in support for detecting unused local variables and parameters. The compiler flags are as follows:

   --noUnusedLocals                    Report Errors on Unused Locals.
   --noUnusedParameters                Report Errors on Unused Parameters.
like image 189
Taytay Avatar answered Oct 05 '22 13:10

Taytay