is there a tool that I can run to find any javascript functions which aren't called from anywhere in my library? (Looking to cut any functions that are no longer being used but weren't cleaned up in the past)
1 Answer
There are a number of libraries ( 'linters' ) that will help you not only find unused functions, but also will point out common potential issues in your code. The most common ones are jslint and eslint. Either of those will go a long way to help avoid common mistakes. Many of them can easily integrated into development environments in atom or vscode.
-
I would definitely go with a Linter (read about static code analysis). One gotcha to look out for, is that, in JS specially, some functions will appear not to be called if they are callbacks.– MawgCommented Dec 2, 2019 at 12:28