Skip to content

Clarity about the what path references are relative toΒ #50529

Open

Description

@kwasimensah

Suggestion

πŸ” Search Terms

references path relative

βœ… Viability Checklist

My suggestion meets these guidelines:

  • [ x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [x ] This wouldn't change the runtime behavior of existing JavaScript code
  • [ x] This could be implemented without emitting different JS based on the types of the expressions
  • [x ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • [x ] This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Both https://www.typescriptlang.org/tsconfig#references and https://www.typescriptlang.org/docs/handbook/project-references.html aren't specific about what the string in path is relative to (the current tsconfig, the current working directory, rootDir, etc)

πŸ’» Use Cases

I'm writing some build scripts around invocations of tsc with a lot of linking, aliasing, etc and I don't want to put absolute paths in the generated tsconfig files

Activity

  1. fatcerberus commented on Aug 29, 2022

    @fatcerberus

    IIRC all paths in a tsconfig are relative to the tsconfig.

  2. kwasimensah commented on Aug 30, 2022

    @kwasimensah
    Author

    So I realized, the feature request hiding in this question is if there could be a way to have a fixed root for tsconfig.json resolution.

    Given root with:
    a/tsconfig.json
    b/tsconfig.json
    c/tsconfig.json

    if there was way to have the references be their root relative paths instead of having to calculate paths relative to each other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions