Skip to content

Remove parseWithNodeMaps #7119

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
JoshuaKGoldberg opened this issue Jun 19, 2023 · 1 comment
Closed

Remove parseWithNodeMaps #7119

JoshuaKGoldberg opened this issue Jun 19, 2023 · 1 comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue breaking change This change will require a new major version to be released enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Milestone

Comments

@JoshuaKGoldberg
Copy link
Member

Overview

Copying @fisker's #6760 (comment):

I want give an update here, we (Prettier) can remove all the invalid node checks after upgrade to latest v6, so we can now use parse dirctly instead of parseWithNodeMaps. I think this method was added because Prettier need it at that moment, feel free to remove it if you think it's unnecessary to keep.

We always like deleting unused code! Just checking on Sourcegraph, https://sourcegraph.com/search?q=context:global+parseWithNodeMaps+-repo:.*typescript-eslint.*+-file:.*node_modules.*&patternType=standard&sm=1&groupBy=repo shows exactly one other runtime use: brodybits/prettierxsrc/language-js/parser-typescript.js: a fork of prettier not updated since 2021. cc @brodybits

I think it's safe to remove parseWithNodeMaps. Filing this issue under triage to check with @typescript-eslint/triage-team.

@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0 milestone Jun 19, 2023
@JoshuaKGoldberg JoshuaKGoldberg added enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree breaking change This change will require a new major version to be released labels Jun 19, 2023
@bradzacher
Copy link
Member

bradzacher commented Jun 20, 2023

This API was added solely for prettier because they had some usecases for checking the source code tokens that we didn't explicitly encode in our AST (but was available via the TS AST). So we can remove this if they no longer need it.

@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Jun 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title Investigate removing parseWithNodeMaps Remove parseWithNodeMaps Jun 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2023
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 breaking change This change will require a new major version to be released enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

No branches or pull requests

2 participants