Skip to content

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

Description

@ekhodx

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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