Skip to content

tsconfig noEmit error: Cannot reference tsconfig if it extends other tsconfig.Β #49844

Closed
@ZerdoX-x

Description

@ZerdoX-x

Bug Report

πŸ”Ž Search Terms

  • tsconfig.json
  • noEmit
  • extends
  • reference
  • Referenced project may not disable emit.

πŸ•— Version & Regression Information

Tried 4.8.0-beta, 4.7.3, 4.7.4, and 4.6.3

⏯ Playground Link

πŸ’» Code

Couldn't reproduce this in Bug Workbench, but here is my minimal reproduction repo:
https://github.com/ZerdoX-x-issue-reproducer/microsoft-TypeScript-49844

tsconfig.json:

{
  "references": [{ "path": "./tsconfig.test.json" }],
  "compilerOptions": {
    "noEmit": true
  }
}

tsconfig.test.json:

{
  "extends": "./tsconfig.base.json",
  "compilerOptions": {
    "composite": true,
    "noEmit": true
  }
}

tsconfig.base.json:

{
  "include": [
    "src/**/*.d.ts",
    "src/**/*.js",
    "src/**/*.ts",
  ],
  "compilerOptions": {
    "noEmit": true,
  }
}

πŸ™ Actual behavior

image

πŸ™‚ Expected behavior

image

πŸ€” Other info

SO question

UPDATE: Since this issue keeps receiving comments and attention, I would like to let you know that I don't suffer from this issue anymore, but reproduction will be opened as long as my account exists :) Afair I was using SvelteKit and I just wanted to get proper type checking for all of my files: 1) source files which would or would not get bundled to be running on client and/or server 2) configuration files, where some files use ESM, some still support only CJS 3) tests.
In newer projects I achieve this goal and do not stumble upon this issue, also it got easier now since new ESLint flat config which will be released in next major release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions