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

Typescript Support #126

Open
axelnormand opened this issue Sep 28, 2020 · 2 comments
Open

Typescript Support #126

axelnormand opened this issue Sep 28, 2020 · 2 comments

Comments

@axelnormand
Copy link

axelnormand commented Sep 28, 2020

Looking forward to using DatoCMS in my new project, thank you for this plugin.

I noticed adding this plugin there is no typescript support.
HelmetDatoCms is not typed and i had to add a .d.ts file to my project saying whats exported from gatsby-source-datocms as there is also nothing in Definitely Typed.

Without the .d.ts file typescript complains about the lack of typing for me.
I did try adding allowJS: true to my tsconfig but that didn't seem to help.

What is the best way i can help adding these?
Ideally you'd want native typescript support in this repo as oppose to possibly out of date types in Definitely Typed?

Thanks

@matjack1
Copy link
Member

Hey Gatsby fans, I'm gauging how much interest for this is there now. For us this would mean a big rewrite as we would need to change the underlying libraries that we are using.

So before taking this big effort we want to know if it would be really useful as of 2023. Please let us know with comments and/or upvotes on this comment. Thanks!

@smonfort-cacd2
Copy link

Hello,
To improve the developer experience, we would also be interested in a better Typescript support with a "Strict Mode" additional option in the Gatsby plugin, as mentioned in #198.
Currently, any required DatoCMS field is considered as nullable in the inferred TS types, which leads to unpleasant non-null assertions.
Thanks!

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

No branches or pull requests

3 participants