title: ESLint Espected an assignment or function call and instead saw an expression on void function
body: <h2>Issue Description:</h2>
  
  <p>I've begun working on a project with <a href="/questions/tagged/typescript" class="post-tag" title="show questions tagged &#39;typescript&#39;" rel="tag">typescript</a> and <a href="/questions/tagged/eslint" class="post-tag" title="show questions tagged &#39;eslint&#39;" rel="tag">eslint</a>. Issue is, eslint gives me an unexpected error on what seems to be a properly declared function</p>
  
  <hr>
  
  <h2>Code:</h2>
  
  <pre><code>import React, { useState } from 'react';
  
  type Props = {
    options: Array&lt;string&gt;
  };
  
  const Switch: React.FC&lt;Props&gt; = (props: Props) =&gt; {
    const [choice, setChoice] = useState&lt;number&gt;(0);
  
    // eslint gives error @ following function
    const handleSwitchChange = ():void =&gt; {
      choice + 1 &gt;= options.length ? setChoice(0) : setChoice(choice + 1)
    };
  
    return (
      &lt;div&gt;{options[choice]}&lt;/div&gt;
      &lt;button onClick={handleSwitchChange}&gt;Change choice&lt;/button&gt;
    );
  };
  </code></pre>
  
  <hr>
  
  <h2>Further details:</h2>
  
  <p>Now this works as expected, but despite the fact the function I'm passing to is of declared type <code>void</code> eslint gives me the following error:</p>
  
  <blockquote>
    <p>Expected an assignment or function call and instead saw an expression.</p>
  </blockquote>
  
  <p>Now I don't want to just disable the rule, but I don't see anything inherently wrong with the code. Is there any way to write the function properly so es-lint doesn't complain? </p>
  
  <hr>
  
  <h2>ESLint error <em>(extra info)</em></h2>
  
  <p>The specific eslint module which raises the error</p>
  
  <pre><code> {
      "resource": "&lt;PATH CENSORED&gt;/src/components/forms/Switch.tsx",
      "owner": "eslint",
      "code": "@typescript-eslint/no-unused-expressions",
      "severity": 8,
      "message": "Expected an assignment or function call and instead saw an expression.",
      "source": "eslint",
      "startLineNumber": 12,
      "startColumn": 5,
      "endLineNumber": 12,
      "endColumn": 85
  }
  </code></pre>