Skip to content

Missing error when referenced project does not have required composite flag #40766

Description

TypeScript Version: 4.0.2

Search Terms: project references composite missing referenced

Code

shared/index.ts:

export const a = 1;

shared/tsconfig.json:

{
  "compilerOptions": {
    // "composite": true,
    "outDir": "../target-tsc-build/",
    "rootDir": ".."
  },
  "files": ["./index.ts"]
}

tsconfig.json:

{
  "references": [
    {
      "path": "./shared/tsconfig.json"
    }
  ],
  "files": []
}

Expected behavior:

When I run tsc --build tsconfig.json --force --verbose, it should error because the referenced project is missing the required composite flag, as per the docs:

Referenced projects must have the new composite setting enabled. This setting is needed to ensure TypeScript can quickly determine where to find the outputs of the referenced project.

https://www.typescriptlang.org/docs/handbook/project-references.html#composite:~:text=Referenced%20projects%20must%20have%20the%20new,composite%20flag%20changes%20a%20few%20things%3A

Actual behavior:

No error

Playground Link:

Related Issues:

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