Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Incorrect no-use-before-define #550

Closed
renchap opened this issue Nov 14, 2018 · 1 comment · Fixed by #551
Closed

Incorrect no-use-before-define #550

renchap opened this issue Nov 14, 2018 · 1 comment · Fixed by #551
Labels

Comments

@renchap
Copy link

renchap commented Nov 14, 2018

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 [email protected]. file.slice is defined, as file is a Blob argument. I think the parser mistakes it with the const slice.

@mysticatea
Copy link
Member

Thank you for the report.

I confirmed it.
I will work on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants