Skip to content

WIP Integrate used tsutils functions #5689

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
wants to merge 26 commits into from

Conversation

varwasabi
Copy link

@varwasabi varwasabi commented Sep 25, 2022

PR Checklist

Overview

To remove the dependency on tsutils the following used functions from that library need to be moved into the type-utils package:

  • getWellKnownSymbolPropertyOfType
  • hasModifier
  • isAssignmentKind
  • isBinaryExpression
  • isBooleanLiteralType
  • isCallExpression
  • isCompilerOptionEnabled
  • isConditionalType
  • isIdentifier
  • isIntersectionType
  • isJsxExpression
  • isModifierFlagSet
  • isNewExpression
  • isObjectFlagSet
  • isObjectType
  • isParameterDeclaration
  • isPropertyAssignment
  • isPropertyDeclaration
  • isPropertyReadonlyInType
  • isStrictCompilerOptionEnabled
  • isSymbolFlagSet
  • isThenableType
  • isTypeFlagSet
  • isTypeReference
  • isUnionOrIntersectionType
  • isUnionType
  • isValidPropertyAccess
  • isVariableDeclaration
  • unionTypeParts

This PR addresses that and removes any use of tsutils across all packages.

@nx-cloud
Copy link

nx-cloud bot commented Sep 25, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4f1cbd7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
nx run-many --target=build --all --parallel --exclude website --exclude website

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @varwasabi!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@netlify
Copy link

netlify bot commented Sep 25, 2022

Deploy Preview for typescript-eslint failed.

Name Link
🔨 Latest commit 4f1cbd7
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6333cb04e26b61000964d12b

@codecov
Copy link

codecov bot commented Sep 25, 2022

Codecov Report

Merging #5689 (cffe5d3) into main (84e316b) will increase coverage by 0.00%.
The diff coverage is 55.43%.

❗ Current head cffe5d3 differs from pull request most recent head 4f1cbd7. Consider uploading reports for the commit 4f1cbd7 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #5689     +/-   ##
=========================================
  Coverage   91.01%   91.02%             
=========================================
  Files         365      348     -17     
  Lines       11962    10203   -1759     
  Branches     3483     3053    -430     
=========================================
- Hits        10887     9287   -1600     
+ Misses        781      657    -124     
+ Partials      294      259     -35     
Flag Coverage Δ
unittest 91.02% <55.43%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/type-utils/src/isNumericPropertyName.ts 0.00% <0.00%> (ø)
...es/type-utils/src/isStrictCompilerOptionEnabled.ts 0.00% <0.00%> (ø)
packages/type-utils/src/isThenableType.ts 4.34% <4.34%> (ø)
...type-utils/src/getWellKnownSymbolPropertyOfType.ts 6.66% <6.66%> (ø)
packages/type-utils/src/isValidPropertyAccess.ts 7.14% <7.14%> (ø)
packages/type-utils/src/isInConstContext.ts 8.69% <8.69%> (ø)
packages/type-utils/src/isCompilerOptionEnabled.ts 10.00% <10.00%> (ø)
...ges/type-utils/src/isNumericOrStringLikeLiteral.ts 20.00% <20.00%> (ø)
.../type-utils/src/isReadonlyAssignmentDeclaration.ts 21.42% <21.42%> (ø)
packages/type-utils/src/isAssignmentKind.ts 25.00% <25.00%> (ø)
... and 131 more

@aaditmshah
Copy link

Any update on this PR?

@JoshuaKGoldberg
Copy link
Member

👋 @varwasabi! I forked tsutils into https://github.com/JoshuaKGoldberg/ts-api-tools and have a replacement PR here: #6428. We really appreciate your work on this PR, but don't think it's in our best interest to continue with it. Thanks so much - and I hope you work on more contributions for typescript-eslint! ❤️


More explanation: I long term don't think we want to be in the business of maintaining a fork of  tsutils in this repo. tsutils has a lot in it and we're already stretched pretty thin in this repository. This PR is over 1k lines added - which isn't a huge amount of code, but still adds a cost.

If we were the only users of tsutils then it'd be pretty reasonable for us to just use it internally and/or as an addition to @typescript-eslint/type-utils. But tsutils is used by a lot of folks. What'd be healthiest for its many consumers is to have a version of it that's actually updated & usable. Hence the hard fork to ts-api-tools.


I'll note that #6428 is still in review right now and ts-api-tools is very new. If it ends up that I'm wrong and we do want to maintain copies of the many tsutils functions in packages/type-utils, then we can certainly reopen this PR - and I can help get it through.

Cheers!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2023
@varwasabi varwasabi deleted the integrate-tsutils branch March 22, 2023 15:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repo: drop dependency on tsutils
3 participants