tsc seemingly not picking up "exclude" options fro tsconfig.json
<p>I am struggling to get tsc to pick up my tsconfig.json file and compile my .ts files. it runs into duplication errors which I am trying to avoid with my tsconfig.json.</p>

<p>I have:</p>

<pre><code>package.json
tsconfig.json
typings.json
typings /
    main/ ...etc
    browser/ ...etc
    main.d.ts
    browser.d.ts
src / ...   &lt;source files in here.&gt;
</code></pre>

<p>My typings.json looks like:</p>

<pre><code>{
  "ambientDependencies": {
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
    "jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
    "node": "registry:dt/node#4.0.0+20160509154515"
  }
}
</code></pre>

<p>My tsconfig.json looks like this:</p>

<pre><code>{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "bower_components",
    "typings/main",
    "typings/main.d.ts"
  ]
}
</code></pre>

<p>and in my package.json / tests object I have:</p>

<pre><code> "tsc": "tsc",
</code></pre>

<p>So I would expect my tsconfig.json to tell tsc to ignore the main.d.ts and the other definitions in main... Avoiding type definition collisions is explained a little more <a href="https://angular.io/docs/ts/latest/guide/typescript-configuration.html#!#typings" rel="nofollow">here</a></p>

<p>So, when I run <code>npm run tsc</code>, I would expect tsc to ignore main.d.ts and everything in main, but it doesn't.</p>

<p>I have seen other issues where <a href="https://github.com/Microsoft/TypeScript/issues/5497" rel="nofollow">tsc ignores tsconfig.json when specific files are defined</a>, but I don't have that case here.</p>

<p>Why is my tsconfig.json being ignored? Why is tsc being so mean to it?!</p>

<p>Any ideas would be appreciated!</p>

<p>Oh by the way, the errors are just several lines of errors like this - errors occur for both main and browser folders:</p>

<pre><code>typings/main/ambient/node/index.d.ts(2067,18): error TS2300: Duplicate identifier 'PassThrough'.
typings/main/ambient/node/index.d.ts(2072,9): error TS2300: Duplicate identifier 'showHidden'.
typings/main/ambient/node/index.d.ts(2073,9): error TS2300: Duplicate identifier 'depth'.
typings/main/ambient/node/index.d.ts(2074,9): error TS2300: Duplicate identifier 'colors'.
typings/main/ambient/node/index.d.ts(2075,9): error TS2300: Duplicate identifier 'customInspect'.
typings/main/ambient/node/index.d.ts(2136,5): error TS2300: Duplicate identifier 'export='.
typings/main/ambient/node/index.d.ts(2144,9): error TS2300: Duplicate identifier 'isRaw'.
typings/main/ambient/node/index.d.ts(2146,9): error TS2300: Duplicate identifier 'isTTY'.
typings/main/ambient/node/index.d.ts(2149,9): error TS2300: Duplicate identifier 'columns'.
typings/main/ambient/node/index.d.ts(2150,9): error TS2300: Duplicate identifier 'rows'.
typings/main/ambient/node/index.d.ts(2151,9): error TS2300: Duplicate identifier 'isTTY'.
typings/main/ambient/node/index.d.ts(2158,18): error TS2300: Duplicate identifier 'Domain'.
</code></pre>

<h2>Edit:</h2>

<p>After swapping to exlcude browser and browser.d.ts in my tsconfig.json and referring to typings/main.d.ts in my reference bath in <code>src/typings.d.ts</code>, I just get these errors:</p>

<pre><code>src/typings.d.ts(3,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'module' must be of type 'NodeModule', but here has type '{ id: string; }'.
typings/main.d.ts(1,1): error TS6053: File 'typings/main/ambient/angular-protractor/index.d.ts' not found.
typings/main.d.ts(5,1): error TS6053: File 'typings/main/ambient/selenium-webdriver/index.d.ts' not found.
</code></pre>