db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

feature request: add JSDoc to create migration template #820

Closed barakplasma closed 1 year ago

barakplasma commented 1 year ago

In the create migration template, we have the opportunity to add JSDoc for type hints in VSCode. So this template: https://github.com/db-migrate/node-db-migrate/blob/50b34a8dd2224e21c5f28843d49511a08d1dbe1b/lib/template.js#L60-L66 Could contain this JSDoc

/**
 *
 * @param {import('db-migrate/lib/interface/migratorInterface')} db
 * @returns
 */
exports.up = function(db) {
  db
  return null;
};

to provide these type hints: image

or

/**
 *
 * @param {import('@types/db-migrate-base')} db
 * @returns
 */
exports.up = function(db) {
  db.runSql()
  return null;
};

from https://www.npmjs.com/package/@types/db-migrate-base to provide these type hints like these: image

barakplasma commented 1 year ago

relates to https://github.com/db-migrate/node-db-migrate/issues/717 which would be much better, but a bit harder to implement

barakplasma commented 1 year ago

not that critical