Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DeprecatebaseUrl compiler option in TypeScript 6.0#62389

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge6 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-62207

Conversation

Copilot
Copy link
Contributor

@CopilotCopilotAI commentedSep 3, 2025
edited
Loading

This PR implements deprecation of thebaseUrl compiler option, which will be removed in TypeScript 7.0. ThebaseUrl option currently performs two functions that can be confusing to users:

  1. Acts as a prefix for all entries inpaths
  2. Acts as a fallback resolution point for bare module imports (often unintended)

Problem

When users configure:

{"compilerOptions": {"baseUrl":"./src","paths": {"@app/*": ["app/*"],"@lib/*": ["lib/*"]    }  }}

An import likeimport * as blah from "blah.js" might resolve to:

  • ./src/app/blah.js
  • ./src/lib/blah.js
  • ./src/blah.js⚠️ (often undesirable)

The last resolution path is usually unintentional and can cause confusion.

Solution

Starting in TypeScript 6.0, usingbaseUrl will show a deprecation warning:

Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

Users should migrate to explicit path mappings:

Before:

{"compilerOptions": {"baseUrl":"./src","paths": {"@app/*": ["app/*"],"@lib/*": ["lib/*"]    }  }}

After:

{"compilerOptions": {"paths": {"@app/*": ["./src/app/*"],"@lib/*": ["./src/lib/*"]    }  }}

To preserve baseUrl fallback behavior (optional):

{"compilerOptions": {"paths": {"*": ["./src/*"],"@app/*": ["./src/app/*"],"@lib/*": ["./src/lib/*"]    }  }}

Implementation

  • Added deprecation check insrc/compiler/program.ts using existing deprecation infrastructure
  • SupportsignoreDeprecations: "6.0" to silence warnings during transition period
  • Added comprehensive test coverage including migration examples
  • Updated 70 existing tests to useignoreDeprecations to prevent test breakage
  • All existing functionality preserved - this is a warning-only change

Fixes#62207.


✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.

CopilotAIand others added5 commitsSeptember 3, 2025 23:23
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
…examplesCo-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
@CopilotCopilotAI changed the title[WIP] Deprecate, remove support forbaseUrlDeprecatebaseUrl compiler option in TypeScript 6.0Sep 3, 2025
Copilot finished work on behalf ofDanielRosenwasserSeptember 3, 2025 23:59
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@DanielRosenwasserDanielRosenwasserAwaiting requested review from DanielRosenwasser

At least 1 approving review is required to merge this pull request.

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Deprecate, remove support forbaseUrl
2 participants
@Copilot@DanielRosenwasser

[8]ページ先頭

©2009-2025 Movatter.jp