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(eslint-plugin): [no-unsafe-argument] add rule#3256
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
Fixes#791This adds a new rule which just checks the passing of arguments.This case is a lot more complex than most cases due to spread arguments.
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. |
Codecov Report
@@ Coverage Diff @@## master #3256 +/- ##==========================================- Coverage 92.91% 92.84% -0.08%========================================== Files 316 317 +1 Lines 10854 10923 +69 Branches 3069 3086 +17 ==========================================+ Hits 10085 10141 +56- Misses 342 348 +6- Partials 427 434 +7
Flags with carried forward coverage won't be shown.Click here to find out more.
|
G-Rath commentedApr 5, 2021 • 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.
@bradzacher do you think this could be another one worth extending in i.e
I know I can satisfy this by casting to In saying that, I am casting for properties due to
Curious on if you have any opinions on if this is something extending :) |
this rule checks arguments using out typescript-eslint/packages/eslint-plugin/src/util/types.ts Lines 418 to 471 incb22561
Which will allow assignments of |
But it looks like there is a bug in the rule. The jest function is typed as: declarefunctiontoHaveBeenCalledWith<Eextendsany[]>(...params:E):void; So at typecheck type, when called with |
which (if I remember and understand everything correctly) they're not - they're typed to receive So:
Gets
(that could be what you mean by |
fabb commentedApr 20, 2021
shouldn't the new rule be added to the |
bradzacher commentedApr 20, 2021 • 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.
It will, but changes to the recommended sets is a breaking change. |
Fixes#791
This adds a new rule which just checks the passing of arguments.
This case is a lot more complex than most cases due to spread arguments.