Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard allows you to use a var before it's declared #659

Closed
dcposch opened this issue Oct 12, 2016 · 2 comments

Comments

@dcposch
Copy link

commented Oct 12, 2016

I don't know if this is intentional, but standard doesn't warn about this:

function foo () {
  console.log('' + x) // prints undefined
  var x = 5
}
@qzb

This comment has been minimized.

Copy link

commented Oct 12, 2016

Yes, this is intentional (at least for now): #636

@feross

This comment has been minimized.

Copy link
Member

commented Oct 12, 2016

I would like standard to catch this issue, but can't enable the relevant rule until eslint/eslint#7111 is fixed.

So, yes, this is intentional for now. See #636 (comment) for explanation.

@feross feross closed this Oct 12, 2016

@feross feross added the question label Oct 12, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.