Skip to content

Enhancement: Explicitly mention allowDefaultProject not matching a file #10048

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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

Right now, if you enable typed linting on an "out-of-project" file not listed in projectService.allowDefaultProject, you get this error:

  0:0  error  Parsing error: path/to/repo/eslint.config.mjs was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject

...but what if you tried to enable it in allowDefaultProject and just mistyped? E.g. typing *.js instead of *.mjs for your eslint.config.mjs?

It'd be nice if we gave an explicit "these are your patterns, none matched". Maybe...

  0:0  error  Parsing error: path/to/repo/eslint.config.mjs was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.
  allowDefaultProject is set to ["*.js"], which does not match 'eslint.config.mjs'.

Additional Info

I have personally made this mistake a bunch of times, and I co-authored the feature 😂. So I think this'd be valuable.

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions