There are tslint rules available for private method. But How can I find out if the public method is not used anywhere in the project and hence candidate for the dead code. I am using Visual studio code for Typescript.
It is currently not possible to detect unused public methods in VSCode (you can check for updates here). However, if it's a private method, you can mark it as private and VSCode is able to look for whether it is used or not within the scope (although do remember: methods used in the HTML template are public).
The quickest way to find dead code is to use a good IDE. Delete unused code and unneeded files. In the case of an unnecessary class, Inline Class or Collapse Hierarchy can be applied if a subclass or superclass is used. To remove unneeded parameters, use Remove Parameter.
Have a look to https://www.npmjs.com/package/ts-unused-exports
It produces an output like this
$ ts-unused-exports tsconfig.json
4 modules with unused exports
src/lambda: handler
src/routes/crud: default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With