Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!