-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[no-unsafe-call] Expand checks to include parameters #1968
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
Comments
From another issue maybe you wanted a new rule called |
That being said a rule like declare function foo(x: any): void
const y = 'text'
foo(y)
const z = 42
foo(z) Aka the potential type error of passing a well typed value into an argument who's type is |
my general thinking with the arguments are a funny thing. They could be included in either
TBH I think that a whole new rule is probably not worth it just for arguments, I think the best place would be adding them to Merging this into #791 |
Would it be possible to keep this issue open as it’s a “bug” in “no-unsafe-call” and not a new rule that needs to be created. The issue that is open which marks this issue as duplicate also does not mention this issue in the body as an action item |
it's not a bug though? it's a feature request. This feature is one of the two reasons #791 is still open. |
Yeah, it's a feature request. Thanks for clarifying. |
Currently
no-unsafe-call
checks for calling a function whose type isany
and lets you know it's unsafe.Repro
Smaller reproduction
Basically if i have a function with type definition for arguments and i call it with an
any
that i received from somewhere else then it should fail.I expect the rule
no-unsafe-call
to catch this because it's about making allCallExpression
in the AST safe ( no unsafe )Expected Result
Warning from typescript-eslint
Actual Result
no warning
Additional Info
Versions
@typescript-eslint/eslint-plugin
X.Y.Z
@typescript-eslint/parser
X.Y.Z
TypeScript
X.Y.Z
ESLint
X.Y.Z
node
X.Y.Z
npm
X.Y.Z
The text was updated successfully, but these errors were encountered: