title: Typescript compiler not finding absolute paths when including files on tsconfig.json
body: <p>I'm trying to use absolute paths when importing modules in JS, unfortunately <code>tsc</code> fails to resolve the paths correctly returning error:</p>
  
  <blockquote>
    <p>Module name 'test2' was not resolved.</p>
  </blockquote>
  
  <p>I have the following file structure</p>
  
  <pre><code>project
  │
  └───tsconfig.json
  └───js
  │   └───another
  │   │   └───child
  │   │       │  test1.js
  │   │
  │   └───some
  │       │  test2.js
  </code></pre>
  
  <p>This is <code>test1.js</code> code:</p>
  
  <pre><code>import { sayHi } from "test2";
  sayHi("John");
  </code></pre>
  
  <p>This is <code>test2.js</code> code:</p>
  
  <pre><code>function sayHi(user) {
    alert(`Hello, ${user}!`);
  }
  
  export { sayHi };
  </code></pre>
  
  <p>and this is my <code>tsconfig.json</code>:</p>
  
  <pre><code>{
    "compilerOptions": {
      "noEmit": true,
      "allowJs": true
    },
    "include": [
      "js/**/*"
    ],
    "exclude": []
  }
  </code></pre>
  
  <p>Via the CLI command when I run <code>tsc --traceResolution</code> and i get the following:</p>
  
  <pre><code>╰─ tsc --traceResolution
  ======== Resolving module 'test2' from '/Users/Sites/LocalTests/js/another/child/test1.js'. ========
  Module resolution kind is not specified, using 'NodeJs'.
  Loading module 'test2' from 'node_modules' folder, target file type 'TypeScript'.
  Directory '/Users/Sites/LocalTests/js/another/child/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/LocalTests/js/another/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/LocalTests/js/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/LocalTests/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/node_modules' does not exist, skipping all lookups in it.
  Directory '/node_modules' does not exist, skipping all lookups in it.
  Loading module 'test2' from 'node_modules' folder, target file type 'JavaScript'.
  Directory '/Users/Sites/LocalTests/js/another/child/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/LocalTests/js/another/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/LocalTests/js/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/LocalTests/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/Sites/node_modules' does not exist, skipping all lookups in it.
  Directory '/Users/node_modules' does not exist, skipping all lookups in it.
  Directory '/node_modules' does not exist, skipping all lookups in it.
  ======== Module name 'test2' was not resolved. ========
  </code></pre>
  
  <p>How do I set it up so that it not only searches up through the directories but also inside sibling directories. Looking at the trace returned it looks like it never looks at the <code>/some</code> directory, therefore never finding <code>test2.js</code>.</p>
  
  <p>Looking at other posts, it seems that I can add the path to <code>/some</code> in the <code>paths:</code> section of <code>tsconfig.json</code> but that means that I would manually had to add every single path, which doesnt make sense as I plan on using multiple directories as this project scales. </p>
  
  <p>Also if youre wondering, I plan on using this <code>tsconfig.json</code> file on VScode for it to find the absolute paths and allowing its "Go To Definition" feature to work correctly.</p>