Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Typescript compatible template #262

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bgschiller
Copy link

This PR tries to be a happy middle-ground between #53 and #131. It's minimally invasive, but it's been working for me locally.

I also ran npm audit fix --force and verified that all the tests still pass.

@luisrudge
Copy link

@bgschiller with this change, does that mean that migrations will still be javascript files, but the TS compiled will type-check it? Meaning: it will still be a .js file and I can't use types inside the migration.

@bgschiller
Copy link
Author

With this change:

  • migrations will still be javascript files
  • TS compiler will type-check it (including your editor, if you have that set up)
  • you can't use type annotation syntax inside the file (because it's still .js)
  • you can use JSDoc comments to annotate the types of values inside the migration file.

I find this is a pretty good balance of convenience and safety

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants