title: Ignore *.js and *.jsx files with tsconfig.json
body: <p>This is what we have tried: </p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "esnext",
      "moduleResolution": "node",
      "allowJs": true,
      "jsx": "react"
    },
    "include": [
      "src/**/*"
    ],
    "exclude": [
      "src/**/*.js",
      "src/**/*.jsx",
    ]
  }
  </code></pre>
  
  <p>When we run <code>tsc</code> from the command line, the compiler is finding errors in <code>jsx</code> and <code>js</code> files. For instance, we are seeing these errors. </p>
  
  <pre><code>src/components/foo/barHeaderStateOverview.jsx:90:46 
      - error TS8010: 'types' can only be used in a .ts file.
  
  90   generateArbitraryData = (id: string, data: {path: string, title: string}) =&gt; {
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  src/components/foo/barHeaderStateOverview.jsx:101:65 
      - error TS1005: ',' expected.
  
  101     const arbitrary = this.generateArbitraryData('weight', data : (string | number));
  </code></pre>
  
  <p>The problem is probably resulting from <a href="https://www.typescriptlang.org/docs/handbook/tsconfig-json.html" rel="noreferrer">this compiler behavior</a>: </p>
  
  <blockquote>
    <p>... if a file B.ts is referenced by another file A.ts, then B.ts cannot be excluded unless the referencing file A.ts is also specified in the "exclude" list.</p>
  </blockquote>
  
  <p>Some of our *.ts files do indeed import *.js and *.jsx files. Is there a way to tell the compiler not to type check those *.js and *.jsx files that the *.ts file import?</p>