lefthook
lefthook copied to clipboard
"Unable to expand glob patterns"
lefthook.yml
:
pre-commit:
parallel: true
commands:
typecheck:
run: 'npx tsc -p .'
react-templates:
glob: '*.{jsx,tsx}'
run: >
npx eslint {staged_files} --fix &&
npx prettier {staged_files} --write &&
git add {staged_files}
scripts:
glob: '*.{js,ts}'
exclude: '.eslintrc.js'
run: >
npx eslint {staged_files} --fix &&
npx prettier {staged_files} --write &&
git add {staged_files}
css:
glob: '*.{css,scss}'
run: >
npx prettier {staged_files} --write &&
npx stylelint {staged_files} --fix &&
git add {staged_files}
other:
glob: '*.{html,md,yml}'
run: >
npx prettier {staged_files} --write &&
git add {staged_files}
This is the error output:
RUNNING HOOKS GROUP: pre-commit
EXECUTE > css
(SKIP. NO FILES FOR INSPECTING)
EXECUTE > other
[error] Unable to expand glob patterns: !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] must provide pattern
lefthook.yml 79ms
EXECUTE > scripts
(SKIP. NO FILES FOR INSPECTING)
EXECUTE > react-templates
(SKIP. NO FILES FOR INSPECTING)
EXECUTE > typecheck
[error] Unable to expand glob patterns: !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] must provide pattern
[error] Unable to expand glob patterns: !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] must provide pattern
SUMMARY: (done in 13.20 seconds)
✔️ other
✔️ typecheck
@ivancuric thank you for issue! I will test it in a few days.
Is it also happens if you run it under Windows SubSystem for Linux?
Haven't tried, the project I'm working on sadly can't run on WSL
Hey @ivancuric! Did you try v1 version of lefthook? Of course, this issue is rather stale but I just want to understand do we still have such a bug.