typicode / husky

Git hooks made easy 🐶 woof!
https://typicode.github.io/husky
MIT License
31.82k stars 1k forks source link

fix: add missing "types" and "main" fields to package.json to allow TS default ex… #1360

Closed jerome-benoit closed 4 months ago

jerome-benoit commented 4 months ago

…port usage

typicode commented 4 months ago

Thank you for the PR :)

I tried using quickly husky as a module in a TS file and didn't get an error. index.d.ts seems to be the default https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html#editing-the-packagejson

So except if I'm missing something, I don't think it's necessary to be explicit about it.

And for main, it's for CommonJS which is not supported by the project.

jerome-benoit commented 4 months ago

The current way the default husky export is currently is not ESM compatible:

https://github.com/SAP/e-mobility-charging-stations-simulator/blob/main/prepare.js

The expected implementation should avoid to use to .default() on imported ESM module. I will open an issue with the repro case.