Supersedes #2950
This PR upgrades husky to version 9. I followed the instructions here to change the dependent files.
@dependabot rebase