My application used moment in lots of places to apply a range of date-time formats.
To achieve consistency, I've switch to wrapping moment formatting inside new formatDate() and formatTime() convenience methods. Now dates and times will always be formatted in consistent methods. I've also been able to include some timezone-sensitive handling in the helpers.
But, in the future it will be all-too-easy to start letting instances of moment.format() into the code again, and allow a range of date-time formats.
Is there a static analysis tool (hopefully CI compliant) that checks that particular classes/methods are NOT used in code?
Obvs there would be an exclusion comment in the two instances where I legitimately used moment.