Skip to content

[Feature]: Support automatic project reference following (equivalent to tsc --build) #1221

Description

@elecmonkey

Background

Using a root tsconfig.json with "files": [] and "references" to sub-projects is a common pattern. The Vite official template, for example, uses this structure:

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

tsc --noEmit on the root does nothing; tsc --build is required to check all referenced sub-projects.

Current Behavior

Rslint only creates programs for tsconfigs explicitly listed in parserOptions.project and does not walk the reference tree. Sub-project files are marked IsSourceFromProjectReference and skipped during type-checking. Currently users must manually enumerate all sub-project tsconfigs (e.g., "tsconfig.*.json") to get full coverage.

This does not prevent files from being linted — lint rules still run normally — so users may get a clean 0-error result while type-checking of referenced projects has silently been skipped.

Proposal

Add a parserOptions.followProjectReferences option. When enabled, Rslint automatically resolves references from each tsconfig and creates programs for all referenced sub-projects. Default: false (preserves existing behavior).

export default defineConfig({
  parserOptions: {
    project: ["./tsconfig.json"],
    followProjectReferences: true,
  },
});

This could later default to true, since silently skipping type-checking of referenced projects is a papercut for new users. Defaulting to recursive checking feels intuitive, but it differs from tsc's default and would be a breaking change — though if the previous default produced zero errors and the new default surfaces real ones, the old behavior was arguably a false sense of safety.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions