Skip to content

Commit

Permalink
Resolves #4583 Add JSDoc (TS flavor) to stub files (#4809)
Browse files Browse the repository at this point in the history
  • Loading branch information
windupbird144 committed Nov 6, 2021
1 parent 75ece73 commit 3aadaea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/migrations/migrate/stub/js.stub
@@ -1,4 +1,7 @@

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function(knex) {
<% if (d.tableName) { %>
return knex.schema.createTable("<%= d.tableName %>", function(t) {
Expand All @@ -8,6 +11,10 @@ exports.up = function(knex) {
<% } %>
};

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function(knex) {
<% if (d.tableName) { %>
return knex.schema.dropTable("<%= d.tableName %>");
Expand Down
3 changes: 3 additions & 0 deletions lib/migrations/migrate/stub/knexfile-js.stub
@@ -1,5 +1,8 @@
// Update with your config settings.

/**
* @type { Object.<string, import("knex").Knex.Config> }
*/
module.exports = {

development: {
Expand Down
5 changes: 4 additions & 1 deletion lib/migrations/seed/stub/js.stub
@@ -1,4 +1,7 @@

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.seed = function(knex) {
// Deletes ALL existing entries
return knex('table_name').del()
Expand Down

0 comments on commit 3aadaea

Please sign in to comment.