#!/bin/bash -e
files=$(git status -s | grep -E '[AM?]+\s.+?\.(js|jsx)$' | cut -c3-)

# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
  exit 0
fi

eslint ${files} --no-ignore;
