Open apottere opened 3 months ago
Thanks for the test repo.
I'm sorry I don't know. Husky doesn't do anything fancy with TS so I'm not sure why it's failing.
There's no build step so you can check directly the code, it's the one that is published.
Do you have the same issue with husky v9.0.8?
Looks like it works in 9.0.8
AFAICT adding "types": "index.d.mts",
to the package.json
gets resolution working for both, but I'm not sure if there are any drawbacks there.
Description
Typescript can't find types for a husky v9 import when using
"moduleResolution": "node"
. It seems to work with"moduleResolution": "nodenext"
(but that causes other issues for me.It's unclear from the release notes whether this is intended as part of the nodejs 14/16 support drop. Feel free to close if it's expected.
Steps to Reproduce
pnpm i
(I also tested with npm, no difference)npx tsc -p tsconfig-nodenext.json
- successnpx tsc -p tsconfig-node.json
This also confirms it's the types in the published package causing this issue with this particular
moduleResolution
, not some quirk of my setup: https://arethetypeswrong.github.io/?p=husky%409.0.11Again, not sure if this is intended.