Skip to content

Enhancement(utils): Allow withoutProjectParserOptions to receive TSESLint.ParserOptions #9827

Closed
@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

Coming over from un-ts/eslint-plugin-import-x#130 (comment): some folks need to use withoutProjectParserOptions on options that are type TSESLint.ParserOptions rather than TSESTreeOptions. But right now the function only allows the latter:

export function withoutProjectParserOptions(
opts: TSESTreeOptions,
): TSESTreeOptions {

Proposal: let's make the function generic so it can return the same type it's given?

Vaguely:

export function withoutProjectParserOptions<Options extends TSESTreeOptions>(
  opts: Options,
): Omit<
  Options,
  'EXPERIMENTAL_useProjectService' | 'project' | 'projectService'
>

Additional Info

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions