JavaScript

JavaScript

By DeepSource

Found empty functions JS-0057

Anti-pattern

Having empty functions hurts readability, and is considered a code-smell. There's almost always a way to avoid using them. If you must use one, consider adding a comment to inform the reader of its purpose.

Bad Practice

getUser('SwaGaLisTiQuE', () => {})

function f() {}

Recommended

getUser('SwaGaLisTiQuE', () => {
    // empty because <reason>
})

function f() {
    // intentionally empty. <reason>
}