title: Why is ESLint throwing warning about unused variable that's used?
body: <p>I've been writing React &amp; ES6 code for about 2 months now. Not sure if I just haven't ran into this problem, or if I'm having a brain freeze this morning.</p>
  
  <p>Did some research and ran into a bunch of articles on <code>const</code> &amp; <code>let</code> but nothing address this. I've been reading that you don't need to use <code>var</code> anymore, so then how would you handle this situation?</p>
  
  <pre><code>function () {
    let variable = null;
  
    if (condition) {
      variable = 'hello world';
    }
  
    console.log(variable); // want 'hello world' if condition
  }
  </code></pre>
  
  <p>Edit: please assume function is being called &amp; condition is <code>true</code>.</p>
  
  <p>I see the code works under these conditions but my confusion is this: before I referenced the variable in the console log, my ESlint reports <code>[eslint]: 'variable' is assigned a value but never used</code>.</p>
  
  <p>Isn't it being used?</p>