title: Is it incorrect to use (type of variable) as condition? es-lint shows Unexpected constant condition
body: <p>I'm setting up a rest api in Javascript and need to check whether a parameter is a boolean.  I can do it using JSON.parse(variable)=='boolean', but this results in an eslint error (no-constant-condition).  I can disable the error for this line, but I'm curious if there is a reason not to do so.</p>
  
  <p>I've read the documentation for the error. </p>
  
  <blockquote>
    <p>A constant expression (for example, a literal) as a test condition might be a typo or development trigger for a specific behavior. For example, the following code looks as if it is not ready for production.</p>
  </blockquote>
  
  <p><a href="https://eslint.org/docs/rules/no-constant-condition" rel="nofollow noreferrer">https://eslint.org/docs/rules/no-constant-condition</a></p>
  
  <p>As far as I can tell, it seems like ignoring it is ok. </p>
  
  <pre><code>try {
    if (!typeof JSON.parse(x) === 'boolean') {
      throw new Error('x must be boolean');
    }
  } catch (e) {
    throw new Error('x must be boolean');
  }
  </code></pre>