1

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

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.

1
  • 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. – Mawg says reinstate Monica Dec 2 '19 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.