title: Typescript parsing error when EXTEND_ESLINT=true in create-react-app
body: <p><a href="https://github.com/ae2438/cra-test" rel="noreferrer">Stripped down demonstration - GitHub</a></p>
  
  <p>We currently have a create-react-app project that is undergoing an incremental migration from Flow to Typescript. This meant disabling some undesirable ESLint rules. In order to customise ESLint, I've added <code>EXTEND_ESLINT=true</code> to the <code>.env</code> file.</p>
  
  <p>Before adding this setting, my Typescript code compiles fine. Afterwards, I get parsing errors on certain (but not all) Typescript grammars.</p>
  
  <pre><code>// Type guards
  export function f0&lt;T&gt;(x: T|undefined): x is T { ...
  
  // Constrained generics
  export function f1&lt;T extends number&gt;(x: T) { ...
  
  // Type assertions
  ... return x as T
  </code></pre>
  
  <p>There may be other unrecognised syntaxes I haven't found yet.</p>
  
  <p><strong>So far</strong></p>
  
  <ul>
  <li><p>I haven't found any similar problems or bug reports. I understand some Typescript features are not available in the current CRA version, such as <code>const enum</code>, but I haven't found any mention of the features listed above. I am also pretty sure my <a href="https://github.com/typescript-eslint/typescript-eslint#supported-typescript-version" rel="noreferrer">Typescript and ESLint versions are compatible</a> with <code>typescript-eslint</code>.</p></li>
  <li><p>I've tried many different <code>.eslintrc</code> combinations. I've left a few of the most promising in the <code>.eslintrc.js</code> file in the attached repository. The current setup is the one <a href="https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-config" rel="noreferrer">recommended by create-react-app</a>, where Typescript linting is set up in the <code>overrides</code> section.</p></li>
  <li><p>The ESLint Typescript configuration was set up following instructions from the <a href="https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser" rel="noreferrer"><code>typescript-eslint</code> monorepo</a>, in particular, <a href="https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser" rel="noreferrer"><code>typescript-eslint/parser</code></a> and <a href="https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin" rel="noreferrer"><code>typescript-eslint/eslint-plugin</code></a></p></li>
  </ul>
  
  <p><strong>Solutions</strong></p>
  
  <ul>
  <li><p>Ejecting is not an option. If no other solution can be found, I would rather just do the Flow -> TS conversion in one go.</p></li>
  <li><p>We currently extend our CRA configuration with <a href="https://github.com/arackaf/customize-cra" rel="noreferrer">customize-cra</a>. Solutions involving this are welcome.</p></li>
  <li><p>I enjoy the flexibility the <code>.eslintrc</code> gives me but I am happy to do away with it, provided I can still set lint rules.</p></li>
  </ul>
  
  <p><strong>Notes</strong></p>
  
  <ul>
  <li><p>I've included <code>customize-cra</code> in the demo repo to accurately reflect our project, but the problem persists without <code>customize-cra</code>, indicating that it is likely not the culprit.</p></li>
  <li><p>See <code>src/components/TestComponent/fn.ts</code> for examples of the problem syntax.</p></li>
  <li><p>My current hypothesis is that there's some setup in the CRA ESLint config that doesn't get carried over when <code>EXTEND_ESLINT=true</code>.</p></li>
  </ul>
  
  <p><strong>Updates</strong></p>
  
  <ul>
  <li><a href="https://github.com/facebook/create-react-app/issues/7855" rel="noreferrer">I've opened an issue at create-react-app</a></li>
  <li>Partial workaround listed on the issue. Still not ideal.</li>
  </ul>