Skip to content
Advertisement

Eslint – No empty first and last lines for function bodies

Which rule is used for converting this code

JavaScript

into

JavaScript

?

Advertisement

Answer

There’s a rule for blocks: padded-blocks.

If enabled, an option is:

“blocks” require or disallow padding within block statements, function bodies, and class static blocks

There doesn’t look to be a configurable option for functions in particular.

You’ll want the config option:

JavaScript

or

JavaScript
Advertisement