title: Typescript: global.d.ts not found
body: <p><code>/tsconfig.json</code></p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;es5&quot;,
      &quot;lib&quot;: [&quot;dom&quot;, &quot;dom.iterable&quot;, &quot;esnext&quot;],
      &quot;allowJs&quot;: true,
      &quot;skipLibCheck&quot;: true,
      &quot;allowSyntheticDefaultImports&quot;: true,
      &quot;strict&quot;: true,
      &quot;forceConsistentCasingInFileNames&quot;: true,
      &quot;noFallthroughCasesInSwitch&quot;: true,
      &quot;module&quot;: &quot;esnext&quot;,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;resolveJsonModule&quot;: true,
      &quot;isolatedModules&quot;: true,
      &quot;noEmit&quot;: true,
      &quot;strictNullChecks&quot;: false,
      &quot;jsx&quot;: &quot;react-jsx&quot;,
      &quot;esModuleInterop&quot;: true,
      &quot;types&quot;: [&quot;node&quot;]
    },
    &quot;include&quot;: [&quot;src&quot;, &quot;src/global.d.ts&quot;]
  }
  
  </code></pre>
  <p><code>src/global.d.ts</code></p>
  <pre><code>type JsonPrimitive = string | number | boolean | null
  interface JsonMap extends Record&lt;string, JsonPrimitive | JsonArray | JsonMap&gt; {}
  interface JsonArray extends Array&lt;JsonPrimitive | JsonArray | JsonMap&gt; {}
  type Json = JsonPrimitive | JsonMap | JsonArray
  
  declare module '*.json' {
    const value: Json
    export default value
  }
  
  </code></pre>
  <p><code>Cannot find name JsonPrimitive</code></p>
  <p>Why can't TS find the global types??</p>
  <p>P.S. I know <code>global.d.ts</code> is NOT the preferred way to get types, but Typescript DOES support that features..</p>