Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(utils): update eslint types#4896
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This just updates eslint types to be in sync with the last few versions.
nx-cloudbot commentedMay 3, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the PR,@bradzacher! 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 onhttps://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day. |
netlifybot commentedMay 3, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site settings. |
codecovbot commentedMay 3, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## main #4896 +/- ##==========================================- Coverage 91.76% 91.56% -0.20%========================================== Files 226 210 -16 Lines 10586 9239 -1347 Branches 3280 2915 -365 ==========================================- Hits 9714 8460 -1254+ Misses 591 522 -69+ Partials 281 257 -24
Flags with carried forward coverage won't be shown.Click here to find out more. |
* The method to asynchronously convert the LintResult objects to text. | ||
* @since 8.4.0 | ||
*/ | ||
format(results: LintResult[]): Promise<string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I could be wrong, but does this actually work? Can you have overloads that differ only by return types? Mytest suggests TS never picks up this overload
JoshuaKGoldbergMay 3, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yeah this should apparently be a union:string | Promise<string>
. Which I find weird but 🤷 compatibility.
eslint/eslint#15242
eslint/eslint#15243
https://eslint.org/docs/developer-guide/nodejs-api#-loadedformatter-type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I was kind of hoping that TS would be smart here and merge the return value type.
I wanted to document the promise-based return separately as it is only accepted in a later version of ESLint.
But if TS won't let me, I'll just merge them together and describe it in the JSDoc 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM - reviewed the ESLint blog posts for the versions and confirmed they all match up. Just need to change the overload to a union and it's good to go!
This just updates eslint types to be in sync with the last few versions.
I just went through thehistory on the nodejs api docs file and compared the commits to what we have.