Skip to content
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

Add rule to cover case when passing any param to function with defined type for the argument #1982

Closed
deser opened this issue May 6, 2020 · 2 comments
Labels
duplicate This issue or pull request already exists enhancement: new plugin rule New rule request for eslint-plugin package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@deser
Copy link

deser commented May 6, 2020

I have all unsafe rules turned on but they don't warn me about case, when I'm passing any to function as argument. Consider example below:

export default function () {
    const lala: any = null;

    function kva(columns: string) {
        console.log(columns);
    }

    kva(lala);
}

Unsafe rules which are turned on:

'@typescript-eslint/no-explicit-any': 1,
'@typescript-eslint/no-unsafe-assignment': 1,
'@typescript-eslint/no-unsafe-call': 1,
'@typescript-eslint/no-unsafe-member-access': 1,
'@typescript-eslint/no-unsafe-return': 1,

Expected Result
Eslint warns me that passing lala of any type to function where this param has not any type.

Actual Result
image
(There is no warning)

Versions

package version
@typescript-eslint/eslint-plugin 2.31.0
@typescript-eslint/parser 2.31.0
TypeScript 3.8.1
ESLint 6.8.0
node 12.16.3
npm 6.14.5
@deser deser added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels May 6, 2020
@bradzacher bradzacher added duplicate This issue or pull request already exists enhancement: new plugin rule New rule request for eslint-plugin and removed triage Waiting for maintainers to take a look labels May 6, 2020
@bradzacher
Copy link
Member

It's on the list of things to do!

See #1968, and comment: #791 (comment)
Merging into $791

@deser
Copy link
Author

deser commented May 6, 2020

Thanks :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists enhancement: new plugin rule New rule request for eslint-plugin package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants