Skip to content
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

Add support for extends as array of strings. #245

Merged
merged 2 commits into from Mar 29, 2023
Merged

Add support for extends as array of strings. #245

merged 2 commits into from Mar 29, 2023

Conversation

DanielSidhion
Copy link
Contributor

@DanielSidhion DanielSidhion commented Mar 20, 2023

Fixes #244.

TypeScript 5.0 added support for defining "extends" as an array of strings. This commit adds support for this use case.

It's important to note that even with this change, "baseUrl" and "paths" are still always being completely overwritten if a later tsconfig redefines any of those values.
This might be confusing because a tsconfig may define "baseUrl=value1" and its own set of "paths" based on that baseUrl, but if a later tsconfig defines its own "baseUrl=value2", the overall config ends up becoming "baseUrl=value2" with the "paths" from the first config.

This behaviour hasn't changed even when "extends" is an array of strings, so this commit maintains this behaviour.

TypeScript 5.0 added support for defining "extends" as an array of
strings. This commit adds support for this use case.

It's important to note that even with this change, "baseUrl" and
"paths" are still always being completely overwritten if a later
tsconfig redefines any of those values.
This might be confusing because a tsconfig may define
"baseUrl=value1" and its own set of "paths" based on that baseUrl,
but if a later tsconfig defines its own "baseUrl=value2", the
overall config ends up becoming "baseUrl=value2" with the "paths"
from the first config.

This behaviour hasn't changed even when "extends" is an array of
strings, so this commit maintains this behaviour.
@DanielSidhion
Copy link
Contributor Author

@jonaskello pinging you because you seem to handle merging PRs in this repo. What's your review and release process like? This PR will help me migrate a bunch of projects I have to TypeScript 5.0 (as long as tsconfig-paths-webpack-plugin also works well with this change, but I'll take a look at that one once this PR is done).

@WoodyWoodsta
Copy link

I'm blocked by this as well (via eslint-plugin-import). TS 5 started its beta 2 months ago :)

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Patch coverage: 82.60% and project coverage change: +0.27 🎉

Comparison is base (910a138) 68.16% compared to head (540a1c1) 68.43%.

❗ Current head 540a1c1 differs from pull request most recent head 62c1b80. Consider uploading reports for the commit 62c1b80 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #245      +/-   ##
==========================================
+ Coverage   68.16%   68.43%   +0.27%     
==========================================
  Files           9        9              
  Lines         311      320       +9     
  Branches       96       99       +3     
==========================================
+ Hits          212      219       +7     
  Misses         93       93              
- Partials        6        8       +2     
Impacted Files Coverage Δ
src/tsconfig-loader.ts 83.56% <82.60%> (-0.82%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ljharb
Copy link

ljharb commented Mar 28, 2023

It'd be great if this could be backported to v3 as well, which has 3-4 times the downloads of v4.

@KozelAnatoliy
Copy link

Would be great to merge this one because it is blocking projects that uses esbuild to migrate to typescript 5

polyipseity added a commit to polyipseity/obsidian-terminal that referenced this pull request Mar 29, 2023
Pending [GH/dividab/tsconfig-paths#245](dividab/tsconfig-paths#245).

Signed-off-by: William So <polyipseity@gmail.com>
@jonaskello
Copy link
Member

@DanielSidhion If I understand correctly this change is not breaking and could be released in a minor version?

@DanielSidhion
Copy link
Contributor Author

@DanielSidhion If I understand correctly this change is not breaking and could be released in a minor version?

That's correct, I kept the same behaviour as before for any extends that's just a string, and TS 5.0 doesn't introduce any breaking changes to how it handles extends that are strings AFAIK.

@jonaskello jonaskello merged commit 5156ef1 into dividab:master Mar 29, 2023
4 checks passed
@jonaskello
Copy link
Member

Released in 4.2.0

@DanielSidhion DanielSidhion deleted the support-extends-array branch March 29, 2023 21:27
@ljharb
Copy link

ljharb commented Mar 30, 2023

@jonaskello any plans to backport this to v3?

domdomegg added a commit to domdomegg/tsconfig-paths that referenced this pull request Dec 5, 2023
…b#245)

TypeScript 5.0 added support for defining "extends" as an array of
strings. This commit adds support for this use case.
jonaskello pushed a commit that referenced this pull request Dec 14, 2023
…260)

TypeScript 5.0 added support for defining "extends" as an array of
strings. This commit adds support for this use case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support TypeScript 5.0's extends array
5 participants