JSDoc has a @deprecated tag that you can use in TypeScript, too. Here’s an
example.
// App.tsx
interface User {
fullName: string;
/** @deprecated use fullName field instead */
lastName: string;
}
function App() {
const user: User = {fullName: 'jake worth', lastName: 'worth'};
return <>{user.lastName}</>;
}
export default App;
In my Vim text editor, COC’s TypeScript server prints this when hover on the use
of user.lastName:
"lastName" is deprecated.
Related information:
* App.tsx#6,7: The declaration was marked as deprecated here.
(tsserver 6385)