Skip to content

Allow projectService to use the default project for virtual processor child files #11839

@CyberT33N

Description

@CyberT33N

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

When using processors like @eslint/markdown with parserOptions.projectService: true, typed linting fails for extracted code blocks because the virtual child paths (e.g., docs/example.md/0.ts) aren't recognized by the project service.

The problem:

file.md/0_0.ts was not found by the project service. 
Consider either including it in the tsconfig.json or including it in allowDefaultProject.

These virtual paths can't be added to tsconfig.json since they don't exist on disk, and adding allowDefaultProject globs for every processor pattern is fragile.

Proposed solution:
When typescript-estree encounters a non-existent path, it should check if a parent path is a real file. If so, treat the path as a virtual child and implicitly allow the default project.

For example:

  • docs/example.md/0.ts → parent docs/example.md exists → allow default project
  • Real files continue to work exactly as today

Related work:

This would eliminate the need for processors to create temp files or for users to maintain complex allowDefaultProject patterns.

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions