This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
Incorrect no-use-before-define #550
Closed
Description
What version of TypeScript are you using?
3.1.3
What version of typescript-eslint-parser
are you using?
21.0.0
What code were you trying to parse?
function test(file: Blob) {
const slice: typeof file.slice =
file.slice || (file as any).webkitSlice || (file as any).mozSlice
return slice
}
What did you expect to happen?
No error should be in eslint
output
What happened?
41:28 error 'slice' was used before it was defined no-use-before-define
This worked fine with typescript-eslint-parser@20.0.0
. file.slice
is defined, as file
is a Blob
argument. I think the parser mistakes it with the const slice
.