I'm working on a codebase where a lot of the React components are being rewritten and replaced over time. Some of those components are "functional" and adding a deprecation tag to them triggers warnings and strikethrough styling in my IDE. But doing the same for a class doesn't trigger the same visual feedback.
Without the feedback from the IDE, and with the sparseness of the JSDoc docs, I'm not sure I've got the syntax right or if the @deprecated
tag applies to classes:
/**
* @deprecated
*/
class OldAndBusted extends React.Component
Does the same syntax apply to classes? Can you mark those as deprecated in the same way as functions?
According to the official documentation (http://jsdoc.app/tags-deprecated.html)
The @deprecated tag marks a symbol in your code as being deprecated.
It is not said that the @deprecated
tag is only for functions. It should be perfectly fine to tag a class as @deprecated
.
The fact that your IDE understands it or not, ... depends on your IDE !
The jsDoc interpretation by IDEs is not complete, and a lot of things are not understood.