title: TypeScript is not picking up my custom type definitions in tsconfig
body: <p>I'm using tsconfig to check my js files. I have my custom type definitions in the <code>custom_types\custom.d.ts</code></p>
  <p><strong>tsconfig.json</strong></p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;es2020&quot;,
      &quot;module&quot;: &quot;commonjs&quot;,
      &quot;allowJs&quot;: true,
      &quot;checkJs&quot;: true,
      &quot;outDir&quot;: &quot;./dist&quot;,
      &quot;strict&quot;: true,
      &quot;typeRoots&quot;: [&quot;./custom_types/&quot;, &quot;node_modules/@types/&quot;],
      &quot;types&quot;: [&quot;node&quot;],
      &quot;esModuleInterop&quot;: true,
      &quot;skipLibCheck&quot;: true,
      &quot;forceConsistentCasingInFileNames&quot;: true
    },
    &quot;include&quot;: [&quot;src/**/*&quot;]
  }
  </code></pre>
  <p><strong>custom_types/custom.d.ts</strong></p>
  <pre><code>declare global {
    const foo: string;
  
    namespace NodeJS {
      interface Global {
        foo: string;
      }
    }
  }
  export default global;
  
  </code></pre>
  <p><strong>src/app.js</strong></p>
  <pre><code>let bar = foo; // Cannot find name 'foo'.ts(2304)
  </code></pre>
  <p>However when I do this in my tsconfig:</p>
  <pre><code>{
    ...
    },
    &quot;include&quot;: [&quot;src/**/*&quot;, &quot;custom_types/custom.d.ts&quot;]
  }
  </code></pre>
  <p>everything work perfect.
  So this makes me think that my <code>tsconfig</code> is wrong and <code>TypesScript</code> completely ignores this part:</p>
  <pre><code>&quot;typeRoots&quot;: [&quot;./custom_types/&quot;, &quot;node_modules/@types/&quot;],
  </code></pre>
  <p>What am I'm doing wrong when trying to specify path to the folder with my own custom type definitions?</p>
  <p>p.s. <code>&quot;node_modules/@types/&quot;</code> is picked up by <code>TypeScript</code> properly (everything that is inside <code>@types</code> is available to me). However <code>&quot;./custom_types/&quot;</code> is ignored.</p>
  <p><strong>UPD:</strong>
  Many answers out there are suggestion to do something with <code>baseUrl</code> and <code>paths</code>. However doing this did nothing for me:</p>
  <pre><code> &quot;baseUrl&quot;: &quot;./&quot;,
      &quot;paths&quot;: {
        &quot;@custom_types&quot;: [&quot;*&quot;, &quot;./custom_types/*&quot;]
      },
      &quot;typeRoots&quot;: [&quot;@custom_types/custom.d.ts&quot;, &quot;node_modules/@types/&quot;],
  
  </code></pre>