It really depends on what standards you follow. Just that it's important to sticking to one. I like the first one.
Also, I do not like using curly for against single line ifs. But, at Hashnode the standard is to use curly line braces even for a single line if. Hence, I stick to it.