Skip to content

biome-check hook doesn't fail when there are lints #58

Description

@tyilo
$ cd /tmp
$ mkdir foo
$ cd foo
$ git init
$ cat > .pre-commit-config.yaml 
repos:
  - repo: https://github.com/biomejs/pre-commit
    rev: v2.2.0 # Use the sha / tag you want to point at
    hooks:
      - id: biome-check
^D
$ echo 'function(a) {}' > main.ts
$ git add .
$ pre-commit run --all-files
biome check..............................................................Passed

I would expect the pre-commit hook to fail and the following to be printed:

main.ts:1:10 lint/correctness/noUnusedVariables  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ⚠ This function f is unused.
  
  > 1 │ function f(a) {}
      │          ^
    2 │ 
  
  ℹ Unused variables are often the result of an incomplete refactoring, typos, or other sources of bugs.
  
  ℹ Unsafe fix: If this is intentional, prepend f with an underscore.
  
    1   │ - function·f(a)·{}
      1 │ + function·_f(a)·{}
    2 2 │   
  

main.ts:1:12 lint/correctness/noUnusedFunctionParameters  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ⚠ This parameter is unused.
  
  > 1 │ function f(a) {}
      │            ^
    2 │ 
  
  ℹ Unused parameters might be the result of an incomplete refactoring.
  
  ℹ Unsafe fix: If this is intentional, prepend a with an underscore.
  
    1   │ - function·f(a)·{}
      1 │ + function·f(_a)·{}
    2 2 │   
  

Checked 1 file in 2ms. No fixes applied.
Found 2 warnings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions