title: Run eslint "ONLY" on the staged files
body: <p>I am trying to use a pre-commit hook to detect eslint errors before commit happens. I am using husky and lint-staged. But it runs the lint command for all the files in src and not on staged files only. Here is my package.json file.</p>
  
  <pre><code>"scripts": {
      "test:ci": "cross-env CI=true react-scripts test --bail --passWithNoTests",
      "lint": "eslint src/**/*.{js,jsx}",
      "lint:fix": "eslint . --fix",
      "precommit": "npm run lint &amp;&amp; npm run test:ci"
    }
  </code></pre>
  
  <pre><code>"husky": {
      "hooks": {
        "pre-commit": "lint-staged"
      }
    },
  </code></pre>
  
  <pre><code>"lint-staged": {
      "*.js": [
        "npm run precommit"
      ],
      "*.jsx": [
        "npm run precommit"
      ]
    }
  </code></pre>
  
  <p>Is there any way so that it works ONLY on staged files and not on other files present in the directory?</p>