title: npm ERR! code EJSONPARSE npm install with husky and lint-staged
body: <p>My <em>package.json</em> works without <em>husky</em> and <em>lint-staged</em> but not with them.
  It's saying:</p>
  <pre><code>npm ERR! code EJSONPARSE
  npm ERR! file C:\Proyectos\my-app\package.json
  npm ERR! JSON.parse Failed to parse json
  npm ERR! JSON.parse Unexpected token ​ in JSON at position 1254 while parsing near '...
  npm ERR! JSON.parse   &quot;lint-staged&quot;: {​​​​​​​​
  npm ERR! JSON.parse     &quot;*.{​​...'
  npm ERR! JSON.parse Failed to parse package.json data.
  npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
  </code></pre>
  <p>What I added in <em>package.json</em> is...</p>
  <blockquote>
  <p>&quot;husky&quot;: {
  &quot;hooks&quot;: {
  &quot;pre-commit&quot;: &quot;npm run test &amp;&amp; prettier --write&quot;,
  &quot;pre-push&quot;: &quot;npm run test &amp;&amp; prettier --write&quot;
  }
  },
  &quot;lint-staged&quot;: {​​​​​​​​
  &quot;*.{​​​​​​​​ts,tsx}​​​​​​​​&quot;: [
  &quot;prettier --write&quot;,
  &quot;git add&quot;
  ]
  }​​​​​​​​</p>
  </blockquote>
  <p>Some user ask me to upload the whole <em>package.json</em>, so here is the code...</p>
  <pre><code>{
    &quot;name&quot;: &quot;my-app&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@testing-library/jest-dom&quot;: &quot;^5.11.5&quot;,
      &quot;@testing-library/react&quot;: &quot;^11.1.0&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^12.1.10&quot;,
      &quot;@types/jest&quot;: &quot;^26.0.15&quot;,
      &quot;@types/node&quot;: &quot;^12.19.3&quot;,
      &quot;@types/react&quot;: &quot;^16.9.55&quot;,
      &quot;@types/react-dom&quot;: &quot;^16.9.9&quot;,
      &quot;@types/styled-components&quot;: &quot;^5.1.4&quot;,
      &quot;lint-staged&quot;: &quot;^10.5.1&quot;,
      &quot;react&quot;: &quot;^17.0.1&quot;,
      &quot;react-dom&quot;: &quot;^17.0.1&quot;,
      &quot;react-scripts&quot;: &quot;4.0.0&quot;,
      &quot;typescript&quot;: &quot;^4.0.5&quot;,
      &quot;web-vitals&quot;: &quot;^0.2.4&quot;
    },
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: [
        &quot;react-app&quot;,
        &quot;react-app/jest&quot;
      ]
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ]
    }​​​​​​​​,
    &quot;devDependencies&quot;: {
      &quot;prettier&quot;: &quot;2.1.2&quot;,
      &quot;styled-components&quot;: &quot;^5.2.1&quot;
    },
    &quot;husky&quot;: {
      &quot;hooks&quot;: {
        &quot;pre-commit&quot;: &quot;npm run test &amp;&amp; prettier --write&quot;,
        &quot;pre-push&quot;: &quot;npm run test &amp;&amp; prettier --write&quot;
      }
    },
    &quot;lint-staged&quot;: {​​​​​​​​
      &quot;*.{​​​​​​​​ts,tsx}​​​​​​​​&quot;: [
        &quot;prettier --write&quot;,
        &quot;git add&quot;
      ]
    }
  }
  </code></pre>