-
Notifications
You must be signed in to change notification settings - Fork 889
return-undefined false positive #2812
Comments
looks like a direct result of #2731. notice the test baseline that got changed: https://github.com/palantir/tslint/pull/2731/files#diff-bd90f0718fe7a8725e9db572ef333339R36 @cartant can you provide a bit more context around the code your'e trying to lint here? should it really be typed ... either way, this behavior is kind of surprising, so we should probably revert that part of the rule change @andy-hanson |
@adidahiya Sure. The typings aren't mine and It's a transaction (
transactionUpdate : (a : any ) => any ,
onComplete ? : (
a : Error | null ,
b : boolean ,
c : firebase.database.DataSnapshot | null
) => any ,
applyLocally ? : boolean
) : firebase.Promise < any > ; I need to implement that interface in a mock. |
@adidahiya And the code that fails the linting is the test for the mock: return mockRef
.transaction((value) => {
return undefined;
})
.then(({ committed, snapshot }) => { Firebase transactions return |
Seeing as though this is a breaking change, is it going to be considered a bug? Or should I implement the trivial workaround that'll be required if this is indeed how you want the rule to work? |
I consider it a bug. Will label it as such. |
Bug Report
TypeScript code being linted
with
tslint.json
configuration:Actual behavior
Expected behavior
No error, as the function parameter is typed as returning
any
- notvoid
.Prior to updating to the latest version of TSLint, the configuration did not see an error effected. No error is effected if 5.2.0 is used.
The text was updated successfully, but these errors were encountered: