commitlint-pre-commit-hook icon indicating copy to clipboard operation
commitlint-pre-commit-hook copied to clipboard

Commit hook fails on a project with tsconfig.json

Open lqc opened this issue 2 years ago • 2 comments

While related to conventional-changelog/commitlint#3256 bug, I think this could be solved in the hooks as pre-commit already provides a (mostly) isolated node environment.

Instead of running the CLI directly, the hook should remember the current path, chdir to the isolated env (NODE_VIRTUAL_ENV) and then run bin/commitlint --cwd $ORIGINAL_PATH $COMMIT_FILE.

lqc avatar Oct 02 '23 08:10 lqc

Hey, thanks for reporting. I'll take a look into this once I get a chance.

alessandrojcm avatar Oct 02 '23 09:10 alessandrojcm

Are you still experiencing this issue? I tried reproducing locally adding a tsconfig.json file to a dummy project and could not reproduce. If you could provide a minimal repro that would be much useful.

alessandrojcm avatar Feb 26 '24 21:02 alessandrojcm