title: What is the best setting for tsconfig.json working with node.js modules?
body: <p>So far I have 2 files in "./src": <code>index.ts</code> and <code>setConfig.ts</code>.
  Both import 'fs' and 'path' like this:</p>
  
  <pre><code>const fs = require('fs');
  const path = require('path');
  </code></pre>
  
  <p>... and that's what Typescript obviously doesn't like; when compiling it says:</p>
  
  <pre><code>src/index.ts:1:7 - error TS2451: Cannot redeclare block-scoped variable 'fs'.
  
  1 const fs = require('fs');
          ~~
  
    src/setConfig.ts:1:7
      1 const fs = require('fs');
              ~~
      'fs' was also declared here.
  
  src/index.ts:2:7 - error TS2451: Cannot redeclare block-scoped variable 'path'.
  
  2 const path = require('path');
          ~~~~
  
    src/setConfig.ts:2:7
      2 const path = require('path');
              ~~~~
      'path' was also declared here.
  
  src/setConfig.ts:1:7 - error TS2451: Cannot redeclare block-scoped variable 'fs'.
  
  1 const fs = require('fs');
          ~~
  
    src/index.ts:1:7
      1 const fs = require('fs');
              ~~
      'fs' was also declared here.
  
  src/setConfig.ts:2:7 - error TS2451: Cannot redeclare block-scoped variable 'path'.
  
  2 const path = require('path');
          ~~~~
  
    src/index.ts:2:7
      2 const path = require('path');
              ~~~~
      'path' was also declared here.
  
  
  Found 4 errors.
  </code></pre>
  
  <p>But when I leave it out in <code>setConfig.ts</code> node complains that it doesn't know 'fs'....</p>
  
  <p>My <code>tsconfig.json</code> looks like this:</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es5",
      "module": "commonjs",
      "outDir": "./dist/",
      "rootDir": "./src/", 
      "strict": true,
      "allowSyntheticDefaultImports": true,
      "esModuleInterop": true,
      "forceConsistentCasingInFileNames": true
    }
  }
  </code></pre>
  
  <p>So, what else do I have to add or do to make my compiled JavaScript work properly?</p>