Open PetrosiliusPatter opened 1 year ago
Ah, I found (part of) the problem: It's the same as https://github.com/denoland/dnt/issues/297!
I had typeCheck: false
in my build script, so it didn't check & notify me about missing types.
Thanks to Deno I didn't actually have to bother with installing the react-types, but when they were missing in the build step, and I turned typeCheck on, errors were raised.
(I was also missing lib: ["ES2021", "DOM"]
in the compiler options, but that was a different issue.)
To include the react typings, I added this to the package-field in my build script:
devDependencies: {
"@types/react": "18.2.0",
},
Then everything worked.
But this feels wrong. Having to add aditional dependencies just for the build step. And having to make sure that the I bump the version for both, if I ever update the dependency.
Is there a better solution?
I'm trying to build my Deno project, but dnt is not inferring my types correctly.
I have the following code:
deps.ts
testHook.ts
index.ts
And the following build script:
build-npm.ts
However, the resulting types are:
testHook.d.ts
So it doesn't seem to be inferring the types from React correctly! How can I fix this / what am I doing wrong?