contentful-migrate
contentful-migrate copied to clipboard
Typescript compatible template
This PR tries to be a happy middle-ground between https://github.com/deluan/contentful-migrate/issues/53 and https://github.com/deluan/contentful-migrate/pull/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.
@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.
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