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

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

merged 1 commit into from Nov 6, 2021

Conversation

windupbird144
Copy link
Contributor

Documents the types of the cli-generated files for init, migrate:make and seed:make. Uses the TS-specific flavor of JSDoc described in the TypeScript Handbook. This enables code hinting. Typescript users can use the checkJs in their project to raise a compilation error e.g. if they forget to return a Promise from the migration function. So this provides an alternative to making the cli generate TS directly with the -x ts option. Being JSDoc, it does not assume any specific module system on the user's machine to import the Knex.

Some screenshots with IntelliSense in Visual Studio Code

Seed, current
seed-before

Seed, PR
seed-after

Knexfile, current
knexfile-before

Knexfile, PR
knexfile-after

Migrations, current
migrations-before

Migrations , PR
migrations-after

Documents the types of the cli-generated files for init, migrate:make and
seed:make. Uses the TS-specific flavor of JSDoc described in the
Typescript Handbook.
Copy link
Collaborator

@OlivierCavadenti OlivierCavadenti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems ok for me, thanks for the contribution !

@OlivierCavadenti OlivierCavadenti merged commit 3aadaea into knex:master Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants