To reproduce:
- Create node.js a project defaulting to ESM ("type": "module")
- Install husky as deps dev
- Import
husky in a prepare.js ESM module and try to run it in the prepare step: import('husky').then(husky => husky()):
TypeError: husky is not a function
at file:///Users/I339261/SAPDevelop/e-mobility-charging-stations-simulator-git/prepare.js:7:33
- And doing
import('husky').then(husky => husky.default()) works
Using the default attribute on husky imported ESM module is not expected.