Skip to content

TS6059 reports half-true reason for file being in the program #43679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rulatir opened this issue Apr 14, 2021 · 1 comment · Fixed by #49040
Closed

TS6059 reports half-true reason for file being in the program #43679

rulatir opened this issue Apr 14, 2021 · 1 comment · Fixed by #49040
Assignees
Labels
Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Experience Enhancement Noncontroversial enhancements Fix Available A PR has been opened for this issue Help Wanted You can do this Rescheduled This issue was previously scheduled to an earlier milestone

Comments

@rulatir
Copy link

rulatir commented Apr 14, 2021

Bug Report

I am going to take a calculated risk here and skip the 1.5h work of form filling, because this seems to be a really simple issue.

This error message is half-true and misleading:

error TS6059: File '/fasthome/rulatir/works/zrup/utility/ts/jsdoc.ts' is not under 'rootDir' '/fasthome/rulatir/works/zrup/ts'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Matched by include pattern '**/*' in '/fasthome/rulatir/works/zrup/tsconfig.json'

The claim in the last line is false. There is no '**/*' include pattern specified anywhere in my tsconfig.json. There is no key in my entire tsconfig.json that contains case-insensitive strings "include" or "pattern". There is not a single occurrence of the string '**/*' in my tsconfig.json.

What this means is that the offending value actually comes from defaults, and should be overriden in tsconfig.json by adding an appropriate key.

Expected last line of the error message:

    Matched by the default include pattern '**/*' (override by setting the <whatever it is named> option in tsconfig.json)
@DanielRosenwasser DanielRosenwasser added Experience Enhancement Noncontroversial enhancements Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this labels Apr 14, 2021
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.4.0 milestone Apr 14, 2021
@DanielRosenwasser
Copy link
Member

If there's a way to detect whether a rule came from the defaults, it would be nice to call that out in --explainFiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Experience Enhancement Noncontroversial enhancements Fix Available A PR has been opened for this issue Help Wanted You can do this Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants