eslint/typescript-eslint-parser

Incorrect no-use-before-define

renchap opened this issue · 1 comments

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.

Thank you for the report.

I confirmed it.
I will work on this.