# lines-before-block

Rule `jsdoc/lines-before-block`. Enforces minimum number of newlines before JSDoc comment blocks

- Source: jsdoc
- Technologies: JSDoc
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2094 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jsdoc/lines-before-block` | no | safe | package `eslint-plugin-jsdoc` | [docs](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md#repos-sticky-header) |

## Code examples

### Incorrect: the rule reports this

```ts
const a = 1;\r
/**\r
 * Desc.\r
 */\r
function quux () {}
```

### Correct: the rule accepts this

```ts
/**
*
*/
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import jsdoc from "eslint-plugin-jsdoc";

export default [
  {
    plugins: { jsdoc },
    rules: {
      "jsdoc/lines-before-block": "error",
    },
  },
];
```

## Related rules

- [jsdoc/convert-to-jsdoc-comments](https://lintradar.dev/rules/jsdoc/convert-to-jsdoc-comments.md): Converts non-JSDoc comments preceding or following nodes into JSDoc ones
- [jsdoc/match-description](https://lintradar.dev/rules/jsdoc/match-description.md): Enforces a regular expression pattern on descriptions.
- [jsdoc/check-examples](https://lintradar.dev/rules/jsdoc/check-examples.md): @deprecated - Use `getJsdocProcessorPlugin` processor; ensures that (JavaScript) samples within `@example` tags adhere to ESLint rules.
- [jsdoc/match-name](https://lintradar.dev/rules/jsdoc/match-name.md): Reports the name portion of a JSDoc tag if matching or not matching a given regular expression.
- [jsdoc/no-missing-syntax](https://lintradar.dev/rules/jsdoc/no-missing-syntax.md): Reports when certain comment structures are always expected.
- [jsdoc/no-restricted-syntax](https://lintradar.dev/rules/jsdoc/no-restricted-syntax.md): Reports when certain comment structures are present.

---

Web page: https://lintradar.dev/rules/jsdoc/lines-before-block. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
