title: lint-staged: what the purpose of 'git add' command
body: <p>Recently I started to introduce <code>lint-staged</code> into my Frontend build tool chain. And when I checked the document about it, I always find it works as following: <br></p>
  <pre><code>&quot;husky&quot;: {
      &quot;hooks&quot;: {
        &quot;pre-commit&quot;: &quot;lint-staged&quot;
      },
  &quot;lint-staged&quot;: {
      &quot;src/**/*.{js,jsx,ts,tsx,json,css}&quot;: [
        &quot;prettier --write&quot;,
        &quot;eslint --fix src/&quot;,
        &quot;tslint --fix --project .&quot;,
        &quot;git add&quot;
      ]
    },
  </code></pre>
  <p>and you can find more similar usage in the link: <a href="https://github.com/okonet/lint-staged" rel="nofollow noreferrer">https://github.com/okonet/lint-staged</a></p>
  <p>My confusing point is the last command <code>git add</code>, what's the purpose of that? <br></p>
  <p>My understand is <code>lint-staged</code> only validate the code in staged area after  <code>git add</code> and before <code>git commit</code>. So can't understand why we need to add one more <code>git add</code> again.</p>