Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enhancement: Add an exported utility to remove type info from parserOptions #8428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
JoshuaKGoldberg opened this issue Feb 10, 2024 · 4 comments · Fixed by #9233
Closed
4 tasks done

Enhancement: Add an exported utility to remove type info from parserOptions #8428

JoshuaKGoldberg opened this issue Feb 10, 2024 · 4 comments · Fixed by #9233
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: typescript-estree Issues related to @typescript-eslint/typescript-estree

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Feb 10, 2024

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

Relevant Package

parser / 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

From @bradzacher's #8424 (comment):

Oh @JoshuaKGoldberg we can fix that! https://github.com/import-js/eslint-plugin-import/blob/7a21f7e10f18c04473faadca94928af6b8e28009/utils%2Fparse.js#L80-L85

I'd forgotten that I'd added this to their setup. We just need to add more deletes. Perhaps we should add a util function to our project so we can control this without touching their code??

Let's do it! Or, actually: eslint-plugin-import does not have a production dependency on any of our packages. And it features a long tail of backwards compatibility for Node.js versions that we don't support. My suspicion (cc @ljharb) is that even if we create & export this utility, eslint-plugin-import might not be able to use it directly.

Filing an issue over there... import-js/eslint-plugin-import#2962 -> https://github.com/import-js/eslint-plugin-import/pull/2963/files#r1485342911

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added enhancement New feature or request triage Waiting for team members to take a look package: typescript-estree Issues related to @typescript-eslint/typescript-estree accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Feb 10, 2024
@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for team members to take a look and removed accepting prs Go ahead, send a pull request that resolves this issue labels Feb 10, 2024
@bradzacher
Copy link
Member

Theres an implicit dep because it loads the users configured parser via the config that eslint provides. So could technically export a function and have it called conditionally - agree though that it is not hugely acceptable to do this - kinda funky.

@ljharb
Copy link

ljharb commented Feb 11, 2024

We can conditionally require it, though, and use it when available, so that would be fine.

It wouldn’t work for PnP users, but that model breaks the import plugin anyways.

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Feb 12, 2024
@fpapado
Copy link
Contributor

fpapado commented Jun 3, 2024

This issue seems to resurface now that @typescript-eslint rc-v8 is using a projectService option (i.e. a new key that has to be deleted). I filed #9223 for it, and I'd be happy to contribute a PR, either for the specific issue, or this more general utility 😌

@JoshuaKGoldberg
Copy link
Member Author

A PR would be great! For this issue, it'd be one that removes both project and projectService / EXPERIMENTAL_useProjectService.

@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Jun 14, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
4 participants