'JSDoc - Is reusing type definitions from other modules an anti-pattern?

Imagine this project structure:

api/
  activity/
    index.js
    activity.d.js <-- JSDOC Type Definitions

contexts/
  activity/
    ActivityContext.jsx 
    ActivityContext.d.js <-- JSDOC Type Definitions

In api/activity/activity.d.js I have the type definition "A" and I wanna reuse it in context/activity/ActivityContext.jsx.

There are two options:

  1. Copying and pasting the specific type definition of api/activity/activity.d.js inside contexts/activity/ActivityContext.d.js.

  2. Or (the one I prefer) importing api/activity/activity.d.js inside contexts/activity/ActivityContext.jsx.

Is it considered an anti-pattern to reuse types from other modules in JSDOC?



Sources

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

Source: Stack Overflow

Solution Source