Empty block statement
52 </div>
53 </div>
54 )
55 {}56}
Empty block statement
55 {images}
56 </div>
57 )
58 {}59}
Description
Empty block statements, while not technically errors, usually occur due to refactoring that wasn't completed. They can mislead the reader.
If you still want to keep an empty block, add a comment saying empty
inside the block.
Bad Practice
if (someCheck) {}
while (someCheck) {}
try {
doSomething();
} catch(err) {
} finally {
}
Recommended
if (someCheck) {
// empty
}
while (someCheck) {
/* empty */
}
try {
doSomething();
} catch (err) {
// continue regardless of error
}
try {
doSomething();
} finally {
/* continue regardless of error */
}