### Environment information ```block CLI: Version: 1.8.3 Color support: true Platform: CPU Architecture: x86_64 OS: linux Environment: BIOME_LOG_DIR: unset NO_COLOR: unset TERM: "xterm-color" JS_RUNTIME_VERSION: "v20.12.2" JS_RUNTIME_NAME: "node" NODE_PACKAGE_MANAGER: unset Biome Configuration: Status: Loaded successfully Formatter disabled: false Linter disabled: false Organize imports disabled: false VCS disabled: true Workspace: Open Documents: 0 ``` ### What happened? Hello, i have pre-commit hook in git which looks like this: ``` ./node_modules/.bin/biome check --staged --no-errors-on-unmatched ``` The issue is that Biome checks staged **files**, but i have unstaged changes, that may cause linter error. For now i ended up with this workaround: ```shell # get staged file names stage_files=$(git diff --cached --name-only) err_output="" # check each staged file via biome check # @see https://biomejs.dev/reference/cli/ for file in $stage_files; do file_content=$(git show ":$file") err_output="$err_output"`echo "$file_content" | ./node_modules/.bin/biome lint --no-errors-on-unmatched --stdin-file-path="$file" 2>&1 > /dev/null` done if [ -n "$err_output" ]; then echo "$err_output" exit 1 fi ``` ### Expected result Would be nice, that biome could have options like `--staged-files` and `--staged-changes`. ### Code of Conduct - [X] I agree to follow Biome's Code of Conduct
Activity
ematipico commentedon Aug 7, 2024
Can you provide a reproduction, or at least some steps to reproduce it locally?
hrasekj commentedon Aug 9, 2024
Yes,
biome lint --stagedematipico commentedon Aug 14, 2024
@hrasekj this is the expected behaviour, because the VCS integration isn't enabled by default. Please refer to this page https://biomejs.dev/guides/integrate-in-vcs/
hrasekj commentedon Aug 14, 2024
@ematipico I've also tested this behavior with VCS enabled, the result was the same.
Ok, then i made gist for my pre-commit hook. Maybe it helps to someone with the same issue.
https://gist.github.com/hrasekj/ec6eb27491643306aed3e04efbd1fda6
ematipico commentedon Aug 14, 2024
Sorry, that wasn't stated in your instructions. Please create a reproduction