-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
While I'm trying to work on #758, I found this behaviour which seems incorrect.
I have an error with below code and to make it silent I had to explicitly type every chain of higher order function.
// with errors
const x = (arg1: string) => {
const tempVar1 = 'temporary value1';
const tempVar2 = 'temporary value2';
return (arg2: number): string => 'foo';
}
// without error(have to explicitly type every chain)
const x = (arg1: string): (arg2: number) => string => {
const tempVar1 = 'temporary value1';
const tempVar2 = 'temporary value2';
return (arg2: number): string => 'foo';
}
It seems like the code is only covering the case that is returning function right away inside of BlockStatement. I think it can be improved so I made a PR #894 Initially I only made a PR but I'm writing this issue for better history tracking.
Aside from this PR, can you review my other PRs too? If you are not satisfied with my implementation, please leave me some comments so that I can apply your feedback. Hope it's not that bad try this time.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.0.0 |
@typescript-eslint/parser |
2.0.0-alpha.0 |
TypeScript |
3.5.1 |
ESLint |
6.0.0 |
node |
11.15.0 |
yarn |
1.16.0 |
samhh and Svish
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin