Skip to content

Remove baseUrl in tsconfig.json #18834

Closed

Description

@xiaoxiangmoe

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/

paths without baseUrl
Using path-mapping is fairly common – often it’s to have nicer imports, often it’s to simulate monorepo linking behavior.

Unfortunately, specifying paths to enable path-mapping required also specifying an option called baseUrl, which allows bare specifier paths to be reached relative to the baseUrl too. This also often caused poor paths to be used by auto-imports.

In TypeScript 4.1, the paths option can be used without baseUrl. This helps avoid some of these issues.

We can remove baseUrl in tsconfig now!

Activity

  1. added this to the Backlog milestone on Sep 21, 2020
  2. angular-robot commented on Feb 2, 2022

    @angular-robot
    Contributor

    Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

    Find more details about Angular's feature request process in our documentation.

  3. modified the milestones: Backlog, needsTriage on Feb 2, 2022
  4. angular-robot commented on Feb 21, 2022

    @angular-robot
    Contributor

    Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

    We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

    You can find more details about the feature request process in our documentation.

  5. added
    feature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authors
    and removed
    feature: votes requiredFeature request which is currently still in the voting phase
    on Feb 21, 2022
  6. xiaoxiangmoe commented on Feb 21, 2022

    @xiaoxiangmoe
    Author

    Can we remove baseUrl in tsconfig.json?
    WebStorm and VSCode support it now.

  7. Gaghyta commented on May 7, 2023

    @Gaghyta

    Hola, gente. Estoy teniendo muchas dudas (y encontrando muy poca información) sobre el contenido del json de tsconfig. Especialemente se me presentó la duda con el baseUrl del tsconfig.json. Una compañera decidió dejar esos archivos y cada vez que uno se baja cambios se terminan generando conflictos. Miré las diferencias y me encuentro con que su tsconfig.json tiene como baseUrl el valor "./", mientras que yo obtengo la compilación correcta con mi archivo que tiene baseUrl con valor "" (vacío) No sé a qué se debe esta diferencia en la baseUrl y estaba buscando información sobre los usos y consecuencias de la misma.
    Agradezco cualquier información que puedan compartir o experiencias personales.

    También vi que hay un tema de diferencia en la creación de componentes, en algunos casos se hace automáticamente con el import del Component, y en otros casos con el NgInit. Lo mismo replicado dentro de la class export, en algunos casos está vacía, en otros predeterminada dentro, incluyendo el constructor vacío, el NgInit y el tipo void

    Al momento, y habiendo iniciado a utilizar Angular hace nada de tiempo, no llego a entender las diferencias de estas configuraciones a nivel de proyecto y si son un tema del cambio de versión de Angular, o si realmente esto de alguna forma afectaría.

    Saludos

  8. added 4 commits that reference this issue on Oct 2, 2023
    6b37e61
    532c2ed
    6f211e0
    18dd051
  9. added a commit that references this issue on Oct 2, 2023
    419b5c1
  10. angular-automatic-lock-bot commented on Nov 2, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Nov 2, 2023
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

    area: @schematics/angularfeatureLabel used to distinguish feature request from other issuesfeature: insufficient votesLabel to add when the not a sufficient number of votes or comments from unique authorsneeds: investigationRequires some digging to determine if action is needed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions