define all jsdoc typedef in a seperate file

JavaScript
// user-helper.js

/**
 * @param {import('./user').User} user
 */
exports.checkAge = user => {
  return user.age >= 18
}// user.js

const checkAge = require('./user-helper')

/**
 * @typedef {Object} User
 * @property {string} name
 * @property {number} age
 */

/**
 * @param {User} user
 */
const createUser = (user) => {
  if (checkAge(user)) {
    db.save(user)
  }
}
Source

Also in JavaScript: