Skip to content

Instantly share code, notes, and snippets.

View hrasekj's full-sized avatar
🕸️
Web developer!

Jakub Hrášek hrasekj

🕸️
Web developer!
View GitHub Profile
@hrasekj
hrasekj / husky_pre-commit
Last active December 23, 2024 14:58
Husky pre-commit hook, that will lint or check only staged changes using biomejs.
#!/usr/bin/env sh
# get staged file names
unstaged_files=$(git diff --name-only)
staged_files=$(git diff --cached --name-only)
err_output=""
# check each staged file via biome check
# @see https://biomejs.dev/reference/cli/
for file in $staged_files; do