title: ESLint: Parsing error: Cannot read file tsconfig.json on WebStorm IDE on WSL2
body: <p>When cloning my repo and doing npm install on WSL2, I am getting this ESLint error on my IDE for all .ts files in my project:</p>
  <blockquote>
  <p>ESLint: Parsing error: Cannot read file <code>\\wsl$\ubuntu-20.04\home\project_directory\tsconfig.json</code></p>
  </blockquote>
  <p>This is showing up because of my <code>parserOptions</code> in my <code>.eslintrc.json</code> file.</p>
  <p>My attempts at solving this issue:</p>
  <ul>
  <li>I followed this thread:
  <a href="https://stackoverflow.com/questions/64933543/parsing-error-cannot-read-file-tsconfig-json-eslint">Parsing error: Cannot read file &#39;.../tsconfig.json&#39;.eslint</a>,
  by converting my json to a js file and using <code>__dirname</code>. However
  that does not fix the issue for me.</li>
  <li>I also tried going into my IDE and manually selecting <code>eslint</code> from
  my project's <code>node_modules</code>. Nothing seems to be removing this error
  for me.</li>
  <li>The weird thing is if I clone my repo on Windows (not WSL), and open the project on Windows, the project works fine and <code>eslint</code> shows no issues. Not sure why it's not working the same on WSL.</li>
  </ul>
  <p>Any help would be appreciated as I am unsure what to do next.</p>
  <p><code>.eslintrc.json</code></p>
  <pre><code>{
      &quot;env&quot;: {
          &quot;browser&quot;: true,
          &quot;es2021&quot;: true,
          &quot;node&quot;: true,
          &quot;jest&quot;: true
      },
      &quot;extends&quot;: [
          &quot;eslint:recommended&quot;,
          &quot;plugin:@typescript-eslint/recommended&quot;,
          &quot;plugin:@typescript-eslint/recommended-requiring-type-checking&quot;,
          &quot;prettier&quot;
      ],
      &quot;parser&quot;: &quot;@typescript-eslint/parser&quot;,
      &quot;parserOptions&quot;: {
          &quot;ecmaVersion&quot;: 2021,
          &quot;sourceType&quot;: &quot;module&quot;,
          &quot;project&quot;: &quot;./tsconfig.json&quot;
      },
      &quot;plugins&quot;: [
          &quot;@typescript-eslint&quot;
      ],
      &quot;rules&quot;: {
          &quot;@typescript-eslint/restrict-template-expressions&quot;: [&quot;error&quot;, {
              &quot;allowNumber&quot;: true,
              &quot;allowBoolean&quot;: true,
              &quot;allowAny&quot;: true,
              &quot;allowNullable&quot;: true
          }],
          &quot;no-use-before-define&quot;: [2, { &quot;functions&quot;: false }],
          &quot;no-underscore-dangle&quot;: 0,
          &quot;block-scoped-var&quot;: 2,
          &quot;no-undef&quot;: 2,
          &quot;no-loop-func&quot;: 1,
          &quot;no-console&quot;: 1,
          &quot;no-debugger&quot;: 2,
          &quot;eqeqeq&quot;: 2,
          &quot;strict&quot;: [2, &quot;function&quot;],
          &quot;no-unused-vars&quot;: [2, { &quot;args&quot;: &quot;none&quot; }],
          &quot;no-prototype-builtins&quot;: &quot;warn&quot;
      }
  }
  
  </code></pre>
  <p><code>tsconfig.json</code></p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      /* Visit https://aka.ms/tsconfig.json to read more about this file */
      /* Basic Options */
      &quot;target&quot;: &quot;ES6&quot;,                                /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */
      &quot;module&quot;: &quot;ESNext&quot;,                           /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
      &quot;sourceMap&quot;: true,                           /* Generates corresponding '.map' file. */
      &quot;outDir&quot;: &quot;dist&quot;,                              /* Redirect output structure to the directory. */
      &quot;strict&quot;: true,                                 /* Enable all strict type-checking options. */
      &quot;moduleResolution&quot;: &quot;node&quot;,                  /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
      &quot;esModuleInterop&quot;: true,                        /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
      &quot;skipLibCheck&quot;: true,                           /* Skip type checking of declaration files. */
      &quot;forceConsistentCasingInFileNames&quot;: true        /* Disallow inconsistently-cased references to the same file. */
    }
  }
  
  </code></pre>
  <p><code>package.json</code></p>
  <pre><code>{
    &quot;name&quot;: &quot;backendbill&quot;,
    &quot;version&quot;: &quot;21.7.0&quot;,
    &quot;description&quot;: &quot;Running on AWS EC2 instance for api and bouncer&quot;,
    &quot;main&quot;: &quot;dist/index.js&quot;,
    &quot;type&quot;: &quot;module&quot;,
    &quot;scripts&quot;: {
      &quot;build&quot;: &quot;rimraf dist &amp;&amp; tsc&quot;,
      &quot;test&quot;: &quot;npx jest --watch&quot;,
      &quot;dev&quot;: &quot;cross-env NODE_ENV=development concurrently \&quot;tsc --watch\&quot; \&quot;nodemon -q dist/index.js\&quot;&quot;,
      &quot;prod&quot;: &quot;cross-env NODE_ENV=production concurrently \&quot;tsc --watch\&quot; \&quot;nodemon -q dist/index.js\&quot;&quot;,
      &quot;deploy&quot;: &quot;pm2 deploy ecosystem.config.cjs production&quot;,
      &quot;lint&quot;: &quot;eslint . --ext .ts&quot;,
      &quot;stage&quot;: &quot;echo \&quot;No tests just yet\&quot;&quot;,
      &quot;prepare&quot;: &quot;husky install&quot;,
      &quot;preserve&quot;: &quot;npm run build&quot;,
      &quot;format&quot;: &quot;prettier --write \&quot;_/_.+(js|json)\&quot;&quot;
    },
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;git+https://github.com/...&quot;
    },
    &quot;author&quot;: &quot;Brother Bill&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;bugs&quot;: {
      &quot;url&quot;: &quot;https://github.com/...&quot;
    },
    &quot;homepage&quot;: &quot;https://github.com/...&quot;,
    &quot;dependencies&quot;: {
      &quot;@types/body-parser&quot;: &quot;^1.19.1&quot;,
      &quot;@types/express&quot;: &quot;^4.17.13&quot;,
      &quot;@types/node&quot;: &quot;^16.3.3&quot;,
      &quot;body-parser&quot;: &quot;^1.19.0&quot;,
      &quot;cross-env&quot;: &quot;^7.0.3&quot;,
      &quot;dotenv&quot;: &quot;^10.0.0&quot;,
      &quot;express&quot;: &quot;^4.17.1&quot;,
      &quot;helmet&quot;: &quot;^4.6.0&quot;,
      &quot;rimraf&quot;: &quot;^3.0.2&quot;,
      &quot;typescript&quot;: &quot;^4.3.5&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@types/jest&quot;: &quot;^26.0.24&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.28.3&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;^4.28.3&quot;,
      &quot;concurrently&quot;: &quot;^6.2.0&quot;,
      &quot;eslint&quot;: &quot;^7.31.0&quot;,
      &quot;eslint-config-prettier&quot;: &quot;^8.3.0&quot;,
      &quot;eslint-config-standard&quot;: &quot;^16.0.3&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.23.4&quot;,
      &quot;eslint-plugin-node&quot;: &quot;^11.1.0&quot;,
      &quot;eslint-plugin-prettier&quot;: &quot;^3.4.0&quot;,
      &quot;eslint-plugin-promise&quot;: &quot;^5.1.0&quot;,
      &quot;husky&quot;: &quot;^7.0.0&quot;,
      &quot;lint-staged&quot;: &quot;^11.0.1&quot;,
      &quot;nodemon&quot;: &quot;^2.0.12&quot;,
      &quot;pm2&quot;: &quot;^5.1.0&quot;,
      &quot;prettier&quot;: &quot;^2.3.2&quot;,
      &quot;ts-jest&quot;: &quot;^27.0.3&quot;
    },
    &quot;lint-staged&quot;: {
      &quot;*.{js,ts,cjs}&quot;: [
        &quot;eslint --cache --fix&quot;,
        &quot;prettier --check&quot;
      ]
    }
  }
  
  </code></pre>
  <p>Config Screenshots:</p>
  <p>Automatic:<br />
  <a href="https://i.stack.imgur.com/qRk8x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qRk8x.png" alt="Automatic" /></a></p>
  <p>Manual:<br />
  <a href="https://i.stack.imgur.com/e0CVf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e0CVf.png" alt="Manual" /></a></p>