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: Migrate functions from @typescript-eslint/type-utils #163

Open
3 tasks done
RebeccaStevens opened this issue Mar 15, 2023 · 5 comments
Open
3 tasks done
Labels
status: accepting prs Please, send a pull request to resolve this! 馃檹 type: feature New enhancement or request 馃殌

Comments

@RebeccaStevens
Copy link
Collaborator

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

Some of the functions there could probably be moved to this project (or at least exists in both).

Additional Info

List of functions:

  • containsAllTypesByName
  • getConstrainedTypeAtLocation
  • getContextualType
  • getDeclaration
  • getSourceFileOfNode
  • getTokenAtPosition
  • getTypeArguments
  • getTypeName
  • isTypeReadonly
  • isUnsafeAssignment
  • isNullableType
  • isTypeArrayTypeOrUnionOfArrayTypes
  • isTypeNeverType
  • isTypeUnknownType
  • isTypeReferenceType
  • isTypeAnyType
  • isTypeAnyArrayType
  • isTypeUnknownArrayType
  • isAnyOrAnyArrayTypeDiscriminated
  • typeIsOrHasBaseType
  • isTypeBigIntLiteralType
  • isTypeTemplateLiteralType
  • getTypeOfPropertyOfName
  • getTypeOfPropertyOfType
  • requiresQuoting
  • getTypeFlags
  • isTypeFlagSet
@RebeccaStevens RebeccaStevens added type: feature New enhancement or request 馃殌 status: in discussion Not yet ready for implementation or a pull request labels Mar 15, 2023
@JoshuaKGoldberg
Copy link
Owner

馃 yeah I don't know how useful adding many of these would be. A lot of those functions are implemented specifically how typescript-eslint would want them.

@RebeccaStevens
Copy link
Collaborator Author

I notice that in one of my projects, I'm currently using getTypeOfPropertyOfType from @typescript-eslint/type-utils and (will be) using a bunch of functions from this library.

I thought that it might be possible for me to drop the dependency on @typescript-eslint/type-utils and just use this library if that function existed here. It seemed like it might be general enough to do so.

@JoshuaKGoldberg
Copy link
Owner

cc @bradzacher - any thoughts here, as you've done more with type-utils than me?

@bradzacher
Copy link
Collaborator

I don't know exactly - some of them are probably general enough to exist here.
the main reason we went down the route of our own package was really because tsutils was unmaintained so there was no way for us to change how things worked, add functions or fix bugs.

If there is broader use outside eslint then for sure we can migrate them!

@JoshuaKGoldberg
Copy link
Owner

Cool in that case it sounds like there's no reason for me to be hesitant. I'm just always reluctant to add things - even though this sounds like it is just making the stuff more publicly visible! 馃槃

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! 馃檹 and removed status: in discussion Not yet ready for implementation or a pull request labels Mar 20, 2023
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

No branches or pull requests

3 participants