Skip to content

Segmentation fault when tsconfig.json contains baseUrl #370

@sheki

Description

@sheki

Bug Description

tsgolint crashes with a segmentation fault when processing a tsconfig.json that contains a baseUrl compiler option.

Steps to Reproduce

  1. Create a minimal tsconfig.json with baseUrl:
{
    "compilerOptions": {
        "jsx": "react-jsx",
        "strict": true,
        "baseUrl": "./"
    }
}
  1. Create a simple TypeScript file:
const x = 1;
  1. Run tsgolint:
tsgolint

Expected Behavior

tsgolint should lint the TypeScript files without crashing.

Actual Behavior

tsgolint crashes with a segmentation fault:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1013eab90]

goroutine 1 [running]:
github.com/microsoft/typescript-go/internal/compiler.(*Program).Host(0x1400015f000?)
	/home/runner/work/tsgolint/tsgolint/typescript-go/internal/compiler/program.go:292
main.runMain()
	/home/runner/work/tsgolint/tsgolint/cmd/tsgolint/main.go:414 +0x6f8
main.main()
	/home/runner/work/tsgolint/tsgolint/cmd/tsgolint/main.go:527 +0x1c

Environment

  • tsgolint version: 0.5.0 (oxlint-tsgolint)
  • Node version: v24.10.0
  • OS: macOS 15.0.0 (Darwin Kernel Version 25.0.0)
  • Architecture: arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions