title: Why does `allowJS` cause an unwanted `src` subdirectory in my compiled output?
body: <p>I'm converting a legacy node/express codebase to TypeScript, following the <a href="https://github.com/Microsoft/TypeScript-Node-Starter" rel="nofollow noreferrer">Microsoft TypeScript starter</a> as a starting reference. </p>
  
  <p>In this reference output is compiled to <code>dist</code>, however when enabling <code>allowJS</code> in <code>tsconfig.json</code>, the output is emitted to <code>dist/src</code> - why is that? </p>
  
  <p>Here is my <code>tsconfig.json</code></p>
  
  <pre><code>{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "noImplicitAny": false,
    "moduleResolution": "node",
    "sourceMap": true,
    "rootDir" : "./",
    "outDir": "dist",
    "baseUrl": ".",
    "allowJs": true,
    "paths": {
      "*": [
        "node_modules/*",
        "src/types/*"
      ]
    }
  },
  "include": [
    "src/**/*"
  ]
  </code></pre>
  
  <p>}</p>
  
  <ul>
  <li>I tried changing <code>rootDir</code> to <code>./src</code> but it gives an error saying 'node_modules/someModule' is not in the src root. </li>
  <li>I tried moving <code>tsconfig.json</code> to src, according to a GitHub issue I saw, but no output was generated. </li>
  </ul>
  
  <p><strong>AllowJS</strong></p>
  
  <p>The output was mapping correctly under <code>/dist</code> until <code>allowJS</code> flag was turned on in <code>tsconfig.json</code>, after which output appeared in <code>/dist/src</code> </p>