Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Ajnasz / pre-commit
Last active April 14, 2018 11:03 — forked from jhartikainen/commit-msg
ESLint git commit hook
#!/bin/sh
files=$(git diff --diff-filter ACMR --cached --name-only | grep '\.js$')
FAILED=0
for file in $files; do
git show :$file | $(npm bin)/eslint --stdin --stdin-filename $file
EXIT_CODE=$?
(function(app) {
var blockNodes, complexComputation,
findNodes, hiddenNodes, hide;
complexComputation = function () {
/* do some complex stuff and return a node */
};
findNodes = function(callback) {
var nodes = [], node;