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
This commit is contained in:
Bjørn Erik Pedersen
2026-06-07 11:41:53 +02:00
parent 7d1b1fb33d
commit ff2903a931
2 changed files with 8 additions and 5 deletions
+2 -4
View File
@@ -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),
},
}
}
+6 -1
View File
@@ -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)
}