Skip to content

Instantly share code, notes, and snippets.

View oussla's full-sized avatar

Nicolas Lagarde oussla

View GitHub Profile
@oussla
oussla / pre-commit-eslint
Last active December 2, 2020 20:41 — forked from shettayyy/pre-commit-eslint
Pre-commit hook for linting staged .js, .jsx or .vue files with ESLint before commit.
#!/bin/sh
#
# Pre-commit hook for linting staged javascript files with ESLint
# From https://gist.github.com/rashtay/328da46a99a9d7c746636df1cf769675
#
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$\|.vue$")
ESLINT="node_modules/.bin/eslint"
printf "\nPre-commit hook: ESLint javascript validation\n"