# @file lefthook.yml
# @ref https://evilmartians.github.io/lefthook/

pre-commit:
  parallel: true
  commands:
    <%_ if (codeLinter === 'biome') { _%>
    biome:
      glob: "*"
      run: npx biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
      stage_fixed: true
    <%_ } else if (codeLinter === 'eslint') { _%>
    eslint:
      glob: "*"
      run: npx eslint --no-error-on-unmatched-pattern --no-warn-ignored --fix {staged_files}
      stage_fixed: true
    <%_ } _%>

commit-msg:
  parallel: true
  commands:
    commitlint:
      run: npx commitlint --edit


