<p dir="auto">I have the following setup:<br>
sources<br>
-- main.ts<br>
---- library<br>
-------- config\base.ts<br>
-------- test\spec.ts<br>
-------- typings<br>
-------------- tsd.d.ts<br>
-------------- lodash\lodash.ts<br>
main.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import config = require(&quot;./library/config/base&quot;)
class main{}"><pre class="notranslate"><code class="notranslate">import config = require("./library/config/base")
class main{}
</code></pre></div>
<p dir="auto">base.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/// &lt;reference path=&quot;../typings/tsd.d.ts&quot; /&gt;
import _ = require(&quot;lodash&quot;)
import Promise = require(&quot;bluebird&quot;)
class ConfigBase{}"><pre class="notranslate"><code class="notranslate">/// &lt;reference path="../typings/tsd.d.ts" /&gt;
import _ = require("lodash")
import Promise = require("bluebird")
class ConfigBase{}
</code></pre></div>
<p dir="auto">spec.ts:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import config = require(&quot;../config/base&quot;)
import server = require(&quot;../../main&quot;)
class testspec{}"><pre class="notranslate"><code class="notranslate">import config = require("../config/base")
import server = require("../../main")
class testspec{}
</code></pre></div>
<p dir="auto">config/base.ts and main.ts compile just fine. However, on compiling test/spec.ts, tsc.cmd errors out including all the .d.ts files from typings directory. Note, that this issue doesn't occur if main.ts is inside the library directory. Errors:<br>
../../library/typings/bluebird/bluebird.d.ts(19,15): error TS2300: Duplicate identifier 'Promise'.<br>
../../library/typings/bluebird/bluebird.d.ts(604,16): error TS2300: Duplicate identifier 'Promise'.<br>
../../library/typings/bluebird/bluebird.d.ts(709,2): error TS2308: A module cannot have more than one export assignment.<br>
../../library/typings/lodash/lodash.d.ts(51,9): error TS2300: Duplicate identifier 'VERSION'.<br>
../../library/typings/lodash/lodash.d.ts(56,9): error TS2300: Duplicate identifier 'support'.<br>
../../library/typings/lodash/lodash.d.ts(62,9): error TS2300: Duplicate identifier 'templateSettings'.<br>
../../library/typings/lodash/lodash.d.ts(73,9): error TS2300: Duplicate identifier 'escape'.<br>
../../library/typings/lodash/lodash.d.ts(78,9): error TS2300: Duplicate identifier 'evaluate'.<br>
../../library/typings/lodash/lodash.d.ts(83,9): error TS2300: Duplicate identifier 'imports'.<br>
../../library/typings/lodash/lodash.d.ts(88,9): error TS2300: Duplicate identifier 'interpolate'.<br>
../../library/typings/lodash/lodash.d.ts(93,9): error TS2300: Duplicate identifier 'variable'.<br>
../../library/typings/lodash/lodash.d.ts(103,9): error TS2300: Duplicate identifier 'argsClass'.<br>
../../library/typings/lodash/lodash.d.ts(108,9): error TS2300: Duplicate identifier 'argsObject'.<br>
../../library/typings/lodash/lodash.d.ts(114,9): error TS2300: Duplicate identifier 'enumErrorProps'.<br>
../../library/typings/lodash/lodash.d.ts(119,9): error TS2300: Duplicate identifier 'fastBind'.<br>
../../library/typings/lodash/lodash.d.ts(125,9): error TS2300: Duplicate identifier 'funcDecomp'.<br>
../../library/typings/lodash/lodash.d.ts(130,9): error TS2300: Duplicate identifier 'funcNames'.<br>
../../library/typings/lodash/lodash.d.ts(136,9): error TS2300: Duplicate identifier 'nonEnumArgs'.<br>
../../library/typings/lodash/lodash.d.ts(144,9): error TS2300: Duplicate identifier 'nonEnumShadows'.<br>
../../library/typings/lodash/lodash.d.ts(149,9): error TS2300: Duplicate identifier 'ownLast'.<br>
../../library/typings/lodash/lodash.d.ts(160,9): error TS2300: Duplicate identifier 'spliceObjects'.<br>
../../library/typings/lodash/lodash.d.ts(168,9): error TS2300: Duplicate identifier 'unindexedChars'.<br>
../../library/typings/lodash/lodash.d.ts(4976,9): error TS2300: Duplicate identifier 'leading'.<br>
../../library/typings/lodash/lodash.d.ts(4981,9): error TS2300: Duplicate identifier 'maxWait'.<br>
../../library/typings/lodash/lodash.d.ts(4986,9): error TS2300: Duplicate identifier 'trailing'.<br>
../../library/typings/lodash/lodash.d.ts(5121,9): error TS2300: Duplicate identifier 'leading'.<br>
../../library/typings/lodash/lodash.d.ts(5126,9): error TS2300: Duplicate identifier 'trailing'.<br>
../../library/typings/lodash/lodash.d.ts(6279,9): error TS2300: Duplicate identifier 'source'.<br>
../../library/typings/lodash/lodash.d.ts(6372,9): error TS2375: Duplicate number index signature.<br>
../../library/typings/lodash/lodash.d.ts(6373,9): error TS2300: Duplicate identifier 'length'.<br>
../../library/typings/lodash/lodash.d.ts(6377,9): error TS2374: Duplicate string index signature.<br>
../../library/typings/lodash/lodash.d.ts(6382,5): error TS2308: A module cannot have more than one export assignment.<br>
../typings/bluebird/bluebird.d.ts(709,2): error TS2308: A module cannot have more than one export assignment.<br>
../typings/lodash/lodash.d.ts(6382,5): error TS2308: A module cannot have more than one export assignment.</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.10</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// A self-contained demonstration of the problem follows...

const ViolationsList = ({
    violations: IViolation[]
}) =&gt; (&lt;div&gt;&lt;/div&gt;);
"><pre class="notranslate"><span class="pl-c">// A self-contained demonstration of the problem follows...</span>

<span class="pl-k">const</span> <span class="pl-smi">ViolationsList</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">violations</span>: <span class="pl-smi">IViolation</span><span class="pl-kos">[</span><span class="pl-s1"></span><span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">&lt;</span><span class="pl-smi">div</span><span class="pl-kos">&gt;</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-smi">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong><br>
This code should compile fine.</p>
<p dir="auto"><strong>Actual behavior:</strong><br>
Error msg printed on line containing <code class="notranslate">violations: IViolation[]</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error TS1005: '=' expected."><pre class="notranslate"><code class="notranslate">error TS1005: '=' expected.
</code></pre></div>
<p dir="auto">If i change the code to not take an array, it compiles fine:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const ViolationsList = ({
    violations: IViolation
}) =&gt; (&lt;div&gt;&lt;/div&gt;);"><pre class="notranslate"><code class="notranslate">const ViolationsList = ({
    violations: IViolation
}) =&gt; (&lt;div&gt;&lt;/div&gt;);
</code></pre></div>
<p dir="auto">This is a serious bug in typescript.</p>