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

Let variable usage is not detected #553

Closed
capaj opened this issue Jun 22, 2016 · 1 comment

Comments

@capaj
Copy link
Contributor

commented Jun 22, 2016

I have this code:

let clarke

test('lala', (t) => {
  clarke = 1
})

When I run standard.js v 7.1.2 I get:

> standard

standard: Use JavaScript Standard Style (http://standardjs.com) 
  /home/capaj/git_projects/mobservable-db/test/queries.spec.js:9:5: 'clarke' is defined but never used

I do not think this is true.
When I change let to var it works and lints just fine.

@feross

This comment has been minimized.

Copy link
Member

commented Jun 22, 2016

Try this:

let clarke

test('lala', (t) => {
  clarke = 1
  console.log(clarke)
})

clarke is not used if you're just setting it, but never reading it's value.

@feross feross closed this Jun 22, 2016

@feross feross added the question label Jun 22, 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.
2 participants
You can’t perform that action at this time.