We can use JSDocs to have a visual indication on VSCode something is deprecated

This article was published on Jan 25, 2021

When we decorate a function variable, class or anything with @deprecated. By doing that, VSCode will understand and show it with a strikethrough style:

/**
 * @deprecated This method is deprecated. Please `render` instead
 */
function oldRender(){}

function render(){}

const TestLib = {
  oldRender,
  render
};

TestLib.oldRender(); // <strikethrough and deprecate message

And it looks like this:

deprecate.png

Resources