typescript-eslint: [2.4.0][Watch] Creating or renaming files throws errors

Original issue tracked in https://github.com/typescript-eslint/typescript-eslint/issues/864

This issue still occurs in Intellij on the latest version 2.4.0 (https://github.com/typescript-eslint/typescript-eslint/releases/tag/v2.4.0) (which includes PR #973). The original reproduction steps apply: Create a new file or rename an existing one and Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. is thrown:

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: foo.ts
The file must be included in at least one of the projects provided.

Versions

package version
@typescript-eslint/parser 2.4.0
TypeScript 3.6.4
ESLint 6.5.1
node 11.10.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Most upvoted comments

@bradzacher this is a very early stage project, and as such I can probably clone it into a public repo for you to take a look at. I will check and get back to you.

Otherwise, I’m using macOS Catalina with stable VSCode.

TL;DR - I relied upon my tests, but my tests didn’t cover enough cases.

So I think I know what happened.

  1. I recorded that video with a set of code.
  2. I wrote a set of tests which tested code.
  3. I then found a bug in the code
  4. I fixed that bug, ensuring the tests passed.
  5. I then put up the PR, linking the video.

The problem is that I didn’t test my change in vscode again. My tests were passing, but they were too simple, and didn’t represent an actual project. My tests tested one situation: where the modified files were in the root folder: include: ["src"], and I created a file in the src folder.

However, the change I made broke detecting changes in deeply nested folders, because my change from (4) incorrectly interpreted when typescript asks for a directory watcher with recursive: undefined as being the same as false (no recursion), when instead, it is supposed to mean infinite recursion depth.

This meant that in a real project which has config include: ["src"], a new file in src/foo did not get detected.

Again, thanks for the explanation! If I can help debug or test in any way, more than happy to.