Skip to content

[ESLint] Why are padded blocks not permitted? #483

@banhathome

Description

@banhathome

I don't quite understand why the ESLint config file prohibits padded blocks. What would happen if you needed to make a comment after a block opens:

// ESLint Error: "Block must not be padded by blank lines. (padded-blocks)"
$document.ready(() => {

  // Initialize/Render React
  React.render(React.createElement(Index), $react.get(0));
  ...
}

// Violates 17.2 of the style guide: "Put an empty line before the [single-line] comment."
$document.ready(() => {
  // Initialize/Render React
  React.render(React.createElement(Index), $react.get(0));
  ...
}

In addition, I don't see anywhere in the style guide where padded blocks are prohibited.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions