Skip to content

Enhancement: Disallow parserOptions.project: [] (prefer false and/or null?) #8210

Closed as not planned
@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

Forwarding @fisker's #8136 (comment) here: right now, it seems there are three ways to turn off parserOptions.project in some way:

  • false
  • null
  • []

That last one, [], is something I didn't know anybody was using (thanks @fisker for mentioning!). My interpretation of parserOptions.project set to an array is that providing a project array says explicitly that there is a list of projects. So not providing any projects in that list means you'll never find the types. If there's no difference between that and false/null, then this is an ambiguity we need to at least document.

Proposal: as a breaking change for v7, if we see an empty array, perhaps we should throw an error (à la #6403) asking the user to either put projects in it, use v7's name for EXPERIMENTAL_useProjectService, or set it to false / null?

Additional Info

Adding to the v7 v8 milestone as we should really lock this down while we have the change to make breaking changes if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions