title: How to ignore Luacheck warnings?
body: <p>The <a href="https://github.com/mpeterv/luacheck/" rel="noreferrer">Luacheck linter</a> produces a warning when an if statement branch doesn't include any statements. For example, if I have a file called <code>test.lua</code> with the following code</p>
  
  <pre class="lang-lua prettyprint-override"><code>local function f(x)
      if x == "hello" then
          -- nothing to do
      elseif x == "world" then
          print(17)
      else
          error("bad value for x")
      end
  end
  
  f("world")
  </code></pre>
  
  <p>Then running <code>luacheck test.lua</code> will produce the following diagnostic</p>
  
  <pre class="lang-none prettyprint-override"><code>Checking test.lua                                 1 warning
  
      test.lua:2:21: empty if branch
  
  Total: 1 warning / 0 errors in 1 file
  </code></pre>
  
  <p>Is there a way to work around this warning? As far as I know there is no configuration option to disable it and trying to some empty statements with a semicolon would not silence the warning either (in fact it would just add an additional warning about the empty statement):</p>
  
  <pre><code>if x == "hello" then
      ;
  elseif ...
  </code></pre>
  
  <p>At the moment the only workaround I can think of involves creating an extra layer of if statements, which I think is less clear than the original version.</p>
  
  <pre><code>if x ~= "hello" then
      if x == "world" then
          print(17)
      else
          error("impossible")
      end
  end
  </code></pre>