Skip to content

Enhancement: Remove errorOnUnknownASTType option from ParseOptions #11246

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

Open
4 tasks done
fisker opened this issue May 24, 2025 · 2 comments
Open
4 tasks done

Enhancement: Remove errorOnUnknownASTType option from ParseOptions #11246

fisker opened this issue May 24, 2025 · 2 comments
Labels
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 triage Waiting for team members to take a look

Comments

@fisker
Copy link
Contributor

fisker commented May 24, 2025

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

I don't think either the ESLint parser or Prettier wants to deal with unknown Node types, currently only ts.SyntaxKind.JSDocFunctionType is forbidden, but JSDocAllType, JSDocUnknownType etc are not. This was discussed in #1525, but I don't think they are useful. Let's remove errorOnUnknownASTType and always throw an error? For JSDoc... type we can throw an error witha better error message rather than "Unknown AST_NODE_TYPE".

I'm planning to drop support for JSDoc... in prettier/prettier#17511

Additional Info

No response

@fisker fisker added enhancement New feature or request triage Waiting for team members to take a look labels May 24, 2025
@bradzacher bradzacher added package: typescript-estree Issues related to @typescript-eslint/typescript-estree breaking change This change will require a new major version to be released labels May 26, 2025
@bradzacher
Copy link
Member

It's worth noting that this option is useful in terms of future TS upgrades too -- if the TS parser adds a new node type then we might not handle it and could thusly crash without this option. Which does put more pressure on us to ensure we have our ducks in a row before the TS versions release and maybe even before the version's RC releases...

I'm a bit torn on this -- cc @typescript-eslint/triage-team thoughts?

@JoshuaKGoldberg
Copy link
Member

Right now there are 14 results for errorOnUnknownASTType in the wild:

...so I don't think this is a common user need. We might want to reach out to the folks explicitly customizing the option to learn why.

Which does put more pressure on us to ensure we have our ducks in a row before the TS versions release and maybe even before the version's RC releases...

😄 This is a good point, and I don't really mind getting that pressure? It's really best for users if we have support ASAP. We've gotten better IMO at making sure it's there quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

3 participants