Possible Errors

Best Practices

Strict Mode

Variables

Node.js and CommonJS

Stylistic Issues

ECMAScript 6

lines-around-comment

- Require empty lines around comments

Fixable

This rule requires empty lines before and/or after comments. It can be enabled separately for both block (/*) and line (//) comments. This rule does not apply to comments that appear on the same line as code and does not require empty lines at the beginning or end of a file.

What ESLint should do when it catches the rule break

Show a warning

Options

beforeBlockComment

Requires an empty line before block comments.

afterBlockComment

Requires an empty line after block comments.

beforeLineComment

Requires an empty line before line comments.

afterLineComment

Requires an empty line after line comments.

allowBlockStart

Allows comments to appear at the start of block statements.

allowBlockEnd

Allows comments to appear at the end of block statements.

allowClassStart

Allows comments to appear at the start of classes.

allowClassEnd

Allows comments to appear at the end of classes.

allowObjectStart

Allows comments to appear at the start of object literals.

allowObjectEnd

Allows comments to appear at the end of object literals.

allowArrayStart

allows comments to appear at the start of array literals.

allowArrayEnd

Allows comments to appear at the end of array literals.

Specifies a regular expression to ignore comments that match a pattern.

applyDefaultIgnorePatterns

Applies default ignore patterns even if ignorePattern is provided.

Rule examples

You can check them out here.