Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: New type type guard: isIntrinsicType #174

Closed
3 tasks done
JoshuaKGoldberg opened this issue Mar 20, 2023 · 0 comments 路 Fixed by #188
Closed
3 tasks done

馃殌 Feature: New type type guard: isIntrinsicType #174

JoshuaKGoldberg opened this issue Mar 20, 2023 · 0 comments 路 Fixed by #188
Labels
status: accepting prs Please, send a pull request to resolve this! 馃檹 type: feature New enhancement or request 馃殌

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

From typescript-eslint/typescript-eslint#6240 (comment):

Yeah, we could do.

TypeScript internally declares IntrinsicType like so:

interface IntrinsicType extends Type {
    intrinsicName: string;
    objectFlags: ObjectFlags;
}

We can also support the more generic case of if a type is any IntrinsicType (rather than a specific one) by checking (type.objectFlags & ts.TypeFlags.Intrinsic) !== 0.

Let's add this type guard in! 馃殌

Additional Info

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! 馃檹 type: feature New enhancement or request 馃殌
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant