Skip to content

Instantly share code, notes, and snippets.

@Ajnasz
Ajnasz / pre-commit
Last active Apr 14, 2018 — forked from jhartikainen/commit-msg
ESLint git commit hook
View pre-commit
#!/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=$?
View kodfejtok_sample.js
(function(app) {
var blockNodes, complexComputation,
findNodes, hiddenNodes, hide;
complexComputation = function () {
/* do some complex stuff and return a node */
};
findNodes = function(callback) {
var nodes = [], node;