title: Typescript / Eslint throws "Cannot read file tsconfig.json" in every project I start
body: <p>In other threads I read that the issue might come when eslint and tsconfig.json are not in the same working folder, but I have all the files in the project's root folder. Somehow, after initializing the project, the thrown error seems to try to find tsconfig.json in the <strong>parent folder</strong> of the project (so, outside the project):</p>
  <p>Let's say the project is in: '\parentFolder\ProjectRoot'
  tsconfig is in the route: '\parentFolder\ProjectRoot\tsconfig.json</p>
  <p>The eslint error I get (at the top of index.ts) is the following:</p>
  <p><em>Parsing error: Cannot read file '<strong>parentFolder</strong>\tsconfig.json'</em></p>
  <ul>
  <li>Note that eslint is somehow looking for tsconfig in the wrong folder (the parent of the root folder)</li>
  </ul>
  <hr />
  <hr />
  <p>The contents of \parentFolder\ProjectRoot are:</p>
  <p>The steps to get to this point have been:</p>
  <ul>
  <li>npm init</li>
  <li>npm i -D typescript</li>
  <li>add &quot;tsc&quot;: &quot;tsc&quot; script to package.json</li>
  <li>npm run tsc -- --init</li>
  <li>npm i express</li>
  <li>npm i -D eslint @types/express @typescript-eslint/eslint-plugin @typescript-eslint/parser</li>
  <li>npm i -D ts-node-dev</li>
  </ul>
  <p><strong>.eslintrc:</strong></p>
  <pre><code>{
    &quot;extends&quot;: [
      &quot;eslint:recommended&quot;,
      &quot;plugin:@typescript-eslint/recommended&quot;,
      &quot;plugin:@typescript-eslint/recommended-requiring-type-checking&quot;
    ],
    &quot;plugins&quot;: [&quot;@typescript-eslint&quot;],
    &quot;env&quot;: {
      &quot;browser&quot;: true,
      &quot;es6&quot;: true
    },
    &quot;rules&quot;: {
      &quot;@typescript-eslint/semi&quot;: [&quot;error&quot;],
      &quot;@typescript-eslint/explicit-function-return-type&quot;: 0,
      &quot;@typescript-eslint/no-unused-vars&quot;: [
          &quot;error&quot;, { &quot;argsIgnorePattern&quot;: &quot;^_&quot; }
      ],
       &quot;@typescript-eslint/no-explicit-any&quot;: 1,
      &quot;no-case-declarations&quot;: 0
    },
    &quot;parser&quot;: &quot;@typescript-eslint/parser&quot;,
    &quot;parserOptions&quot;: {
      &quot;project&quot;: &quot;./tsconfig.json&quot;
    }
  }
  </code></pre>
  <p><strong>tsconfig.json</strong></p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;ES6&quot;,
      &quot;outDir&quot;: &quot;./build/&quot;,
      &quot;module&quot;: &quot;commonjs&quot;,
      &quot;strict&quot;: true,
      &quot;noUnusedLocals&quot;: true,
      &quot;noUnusedParameters&quot;: true,
      &quot;noImplicitReturns&quot;: true,
      &quot;noFallthroughCasesInSwitch&quot;: true,
      &quot;esModuleInterop&quot;: true
    }
  }
  </code></pre>
  <p><strong>package.json</strong> (looks like changing index.js to index.ts in &quot;main&quot; does nothing)</p>
  <pre><code>{
    &quot;name&quot;: &quot;server&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
      &quot;tsc&quot;: &quot;tsc&quot;,
      &quot;dev&quot;: &quot;ts-node-dev index.ts&quot;,
      &quot;lint&quot;: &quot;eslint --ext .ts .&quot;
    },
    &quot;keywords&quot;: [],
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;devDependencies&quot;: {
      &quot;@types/express&quot;: &quot;^4.17.9&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.9.0&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;^4.9.0&quot;,
      &quot;eslint&quot;: &quot;^7.14.0&quot;,
      &quot;ts-node-dev&quot;: &quot;^1.0.0&quot;,
      &quot;typescript&quot;: &quot;^4.1.2&quot;
    },
    &quot;dependencies&quot;: {
      &quot;express&quot;: &quot;^4.17.1&quot;
    }
  }
  </code></pre>
  <p><strong>index.ts</strong>
  (I get implicity errors here in req and res, I imagine caused by the fact that tsconfig can't be found).</p>
  <pre><code>const express = require('express');
  const app = express();app.use(express.json());
  const PORT = 3000;
  app.get('/ping', (_req, res) =&gt; {
    res.send('pong');
  });
  app.listen(PORT, () =&gt; {
    console.log(`Server running on port ${PORT}`);
  });
  </code></pre>
  <hr />
  <hr />
  <p><strong>edit:</strong></p>
  <p>I had typescript installed globally (and also as a dev dependency in these projects). Thinking this might be the issue, I uninstalled the global version of typescript.</p>
  <p>When checking all global packages with npm list -g --depth 0, I get the following:</p>
  <p><a href="https://i.stack.imgur.com/ZXPPE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZXPPE.png" alt="enter image description here" /></a></p>
  <p>I don't know if that would be related to the issue.</p>