Skip to content

Instantly share code, notes, and snippets.

View nick0602's full-sized avatar
🧐

Niccolò Forlini nick0602

🧐
View GitHub Profile
@nick0602
nick0602 / pre-commit
Last active March 16, 2020 14:18 — forked from broofa/pre-commit
Git pre-commit hook that runs `eslint` with the `--fix` option to fix up issues where possible, and adds "fix"ed files into the commit
#!/bin/bash
cd "$(git rev-parse --show-toplevel)"
ESLINT="node_modules/.bin/eslint"
pwd
if [[ ! -x "$ESLINT" ]]; then
printf "\t\033[41mPlease install eslint\033[0m (npm install eslint)\n"
exit 1
fi