"Hello, World!" in zero lines of code
Haskell, 36 35 bytes
{-{--}--}main=putStr&quot;Hello, world!&quot;

Try it online!
Test sloc
Since sloc is regex based it is a very good guess to think it cannot identify nested comments.  And if we take a look we see that indeed it cannot.  If we nest two comments as so:
{-{--}-}

sloc identifies one line of source and one line of comment.  Based on these observations my best guess is that the regex it is using is
(\{-((?!-\}).)*-\}|--[^\n]*)

If we pop this into a regex engine we will see it matches the nested comment as so:
      code
      ^^
{-{--}-}
^^^^^^
comment

Ok so we broke it, however this has the opposite of the intended effect.  We want sloc to think our code is a comment rather than our comment is code.  So we add a &quot;line comment marker&quot; to the part of the comment sloc thinks is code, so that sloc thinks a line comment is being started.
{-{--}--}

So to sloc there are two comments the block comment {-{--} and the line comment --} but to haskell which actually parses comments, it is all one block comment.
So then we just add our code after.  Sloc thinks this is still a comment and Haskell knows it is not.