Skip to content

Instantly share code, notes, and snippets.

@luuuis
luuuis / pre-commit.sh
Last active September 19, 2021 16:18 — forked from dahjelle/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes.
#!/usr/bin/env bash
set -uo pipefail
IFS=$'\n\t'
#
# Improvements from dahjelle/pre-commit.sh:
# - does not lint deleted files,
# - lints all staged files before exiting with an error code,
# - handles spaces and other unusual chars in file names.
#