Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #4583 Add JSDoc (TS flavor) to stub files #4809

Merged
merged 1 commit into from Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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