'How to scan for decorator tags in javascript build?

I wrote a decorator that makes code as obsolete, my question would be, is there a way that I can have a build process that detects this decorator is used in a method, and thus raises some sort of warning?

Like the code below annotated with some decorator:

@Obsolete
private deadMethod(){
/// dead code
}

/// throws some warning during build phase

Then during NPM build/Webpack build, this decorator usage gets flagged as some warning/error. Is that possible? I was trying to find ways to retrieve what decorators are used in a method programmatically and I couldn't find anything.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source