From ff2903a9317ba45a65f9963f837c66cc6bce3c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 7 Jun 2026 11:41:53 +0200 Subject: [PATCH] resources/jsconfig: Remove deprecated baseUrl setting baseUrl is deprecated in TypeScript and is no longer required when paths is set (TypeScript 4.1+). Fixes #14991 Closes #14996 --- resources/jsconfig/jsconfig.go | 6 ++---- resources/jsconfig/jsconfig_test.go | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/jsconfig/jsconfig.go b/resources/jsconfig/jsconfig.go index dfc2f235d..4aabf69f7 100644 --- a/resources/jsconfig/jsconfig.go +++ b/resources/jsconfig/jsconfig.go @@ -61,8 +61,7 @@ func (b *Builder) AddSourceRoot(root string) { // CompilerOptions holds compilerOptions for jsonconfig.json. type CompilerOptions struct { - BaseURL string `json:"baseUrl"` - Paths map[string][]string `json:"paths"` + Paths map[string][]string `json:"paths"` } // Config holds the data for jsconfig.json. @@ -73,8 +72,7 @@ type Config struct { func newJSConfig() *Config { return &Config{ CompilerOptions: CompilerOptions{ - BaseURL: ".", - Paths: make(map[string][]string), + Paths: make(map[string][]string), }, } } diff --git a/resources/jsconfig/jsconfig_test.go b/resources/jsconfig/jsconfig_test.go index 9a9657843..ab9b739d1 100644 --- a/resources/jsconfig/jsconfig_test.go +++ b/resources/jsconfig/jsconfig_test.go @@ -14,6 +14,7 @@ package jsconfig import ( + "encoding/json" "path/filepath" "testing" @@ -28,8 +29,12 @@ func TestJsConfigBuilder(t *testing.T) { b.AddSourceRoot("/d/assets") conf := b.Build("/a/b") - c.Assert(conf.CompilerOptions.BaseURL, qt.Equals, ".") c.Assert(conf.CompilerOptions.Paths["*"], qt.DeepEquals, []string{filepath.FromSlash("../../c/assets/*"), filepath.FromSlash("../../d/assets/*")}) + // baseUrl is deprecated in TypeScript and not needed when paths is set; see issue 14991. + data, err := json.Marshal(conf) + c.Assert(err, qt.IsNil) + c.Assert(string(data), qt.Not(qt.Contains), "baseUrl") + c.Assert(NewBuilder().Build("/a/b"), qt.IsNil) }