Skip to content

tsgo resolves inherited include/exclude globs differently than tsc when using extends #2699

@mabels

Description

@mabels

Versions

  • tsc: 5.9.3
  • tsgo (@typescript/native-preview): 7.0.0-dev.20260206.1

Description

When a child tsconfig.json uses "extends" to inherit from a parent, and the parent defines include globs, tsc and tsgo produce completely different output directory structures because they resolve the inherited include paths differently.

Note: This is a regression — this was working correctly with tsgo a few weeks ago.

Setup

monorepo-root/
├── tsconfig.json          # parent config
├── call-ai/...
├── prompts/...
├── use-vibes/...
└── vibes.diy/pkg/
    └── tsconfig.json      # child config (extends ../../tsconfig.json)

Parent tsconfig.json (at root):

{
  "compilerOptions": {
    "target": "es2022",
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "outDir": "./dist",
    "noEmit": true,
    "sourceMap": true
  },
  "include": [
    "call-ai/**/*",
    "use-vibes/**/*",
    "vibes.diy/**/*",
    "prompts/**/*"
  ]
}

Child tsconfig.json (at vibes.diy/pkg/):

{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "outDir": "./dist",
    "sourceMap": true,
    "noEmit": false
  }
}

Steps to reproduce

From vibes.diy/pkg/:

rm -rf dist && pnpm exec tsc 2>/dev/null; ls dist/
# Output: call-ai  prompts  use-vibes  vibes.diy

rm -rf dist && pnpm exec tsgo 2>/dev/null; ls dist/
# Output: app  drizzle.d1-local-backend.config.js  ...  stories  workers

Expected behavior

tsgo should produce the same output directory structure as tsc — resolving inherited include globs relative to the parent config's directory (monorepo root), producing dist/{call-ai,prompts,use-vibes,vibes.diy}.

Actual behavior

tsc resolves the inherited include globs relative to the parent config's directory (monorepo root), producing dist/{call-ai,prompts,use-vibes,vibes.diy}.

tsgo appears to resolve them relative to the child config's directory (vibes.diy/pkg/), producing a flat structure with only local files (app/, stories/, workers/, config files).

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