-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix(eslint-plugin): [explicit-function-return-type, explicit-module-boundary-types] improved checking for allowHigherOrderFunctions option #8508
Conversation
Thanks for the PR, @yeonjuan! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
82ccc02
to
0d5d17c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8508 +/- ##
==========================================
+ Coverage 87.14% 87.35% +0.21%
==========================================
Files 251 252 +1
Lines 12272 12456 +184
Branches 3871 3914 +43
==========================================
+ Hits 10694 10881 +187
+ Misses 1306 1304 -2
+ Partials 272 271 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
… for allowHigherOrderFunctions option
@JoshuaKGoldberg |
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.
Love it, this is great! 🤩
Just the one note on a return
outside a function. Otherwise really nicely crafted.
Oh and just a heads up, although there isn't a technical Git merge conflict, #8019 being merged is giving this a lint failure in CI. /home/runner/work/typescript-eslint/typescript-eslint/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
117:14 error Forbidden non-null assertion @typescript-eslint/no-non-null-assertion |
packages/eslint-plugin/src/rules/explicit-function-return-type.ts
Outdated
Show resolved
Hide resolved
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.
PR Checklist
Overview
The
explicit-function-return-type
's issue(#928) also occured inexplicit-module-boundary-types
because two rule use same util (explicitReturnTypeUtils.ts).I changed the code to collect the return statements inside the function, pass them to
explicitReturnTypeUtils
, and check whether it is a highOrderFunction or not. (#894 (comment))