How to replicate the bug

  1. Clone this repo
  2. From the root of the repo, run yarn --cwd ./tool/ install
  3. Change into the project-to-lint directory (via cd project-to-lint)
  4. Verify that compilation works with yarn compile
  5. Run yarn node ../tool/index.js
  6. See that the parser can't find the @types/* packages

Working around the bug

The project-with-workaround/ directory is identical to the project-to-lint/ directory, except for the fact that its .eslintrc.json file specifies the parser itself, which causes ESlint to look in project-with-workaround/ instead of tool/ for the @typescript-eslint/parser package. Because the @typescript-eslint/parser package it finds is located in a project using Yarn 2 with Plug'n'Play, it then has no trouble finding the @types/* packages.