How to detect unused variables in Typescript?

Damjan Pavlica picture Damjan Pavlica · May 25, 2016 · Viewed 11k times · Source

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

Answer

Taytay picture Taytay · Jul 14, 2016

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.