microsoft / microsoft/TypeScript

SourceRoot documentation inconsistent

Open
#28,099 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Docs
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

In the compiler options documentation is sourceRoot explained as follows:

Specifies the location where debugger should locate TypeScript files instead of source locations. Use this flag if the sources will be located at run-time in a different location than that at design-time. The location specified will be embedded in the sourceMap to direct the debugger where the source files will be located.

In the documentation of the extends property is explained that all path are relative to the file they originated in.

All relative paths found in the configuration file will be resolved relative to the configuration file they originated in.

I have understood that the path in sourceRoot is relative to the compiled files and points to the source files. sourceRoot is not relative to the configuration file it originates in. If I use a path relative to the configuration file, the source files are not found.

Expected behavior:
The documentation must be consistent or the path must be relative to the file they originated in.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked compiler options documentation and the tsconfig.json documentation for the extends property, then verify how sourceRoot paths are resolved. Reconcile the two explanations so the documented behavior is consistent, or document the actual path base clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.