# multiline-comment-style

Rule `eslint/multiline-comment-style`. Enforce a particular style for multiline comments

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `multiline-comment-style` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/multiline-comment-style) |

## Code examples

### Incorrect: the rule reports this

```js
// this line
// calls foo()
foo();

/* this line
calls foo() */
foo();

/* this comment
 * is missing a newline after /*
 */

/*
 * this comment
 * is missing a newline at the end */

/*
* the star in this line should have a space before it
 */

/*
 * the star on the following line should have a space before it
*/
```

```js
// this line
// calls foo()
foo();

/*
 * this line
 * calls foo()
 */
foo();
```

```js
/* This line
calls foo() */
foo();

/*
 * This line
 * calls foo()
 */
foo();
```

### Correct: the rule accepts this

```js
/*
 * this line
 * calls foo()
 */
foo();

// single-line comment
```

```js
/* this line
   calls foo() */
foo();
```

```js
// This line
// calls foo()
foo();
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "multiline-comment-style": "error",
    },
  },
];
```

## Related rules

- [eslint/sort-keys](https://lintradar.dev/rules/eslint/sort-keys.md): Require object keys to be sorted
- [eslint/sort-imports](https://lintradar.dev/rules/eslint/sort-imports.md): Enforce sorted `import` declarations within modules
- [eslint/no-undefined](https://lintradar.dev/rules/eslint/no-undefined.md): Disallow the use of `undefined` as an identifier
- [eslint/id-length](https://lintradar.dev/rules/eslint/id-length.md): Enforce minimum and maximum identifier lengths
- [eslint/no-ternary](https://lintradar.dev/rules/eslint/no-ternary.md): Disallow ternary operators
- [eslint/no-magic-numbers](https://lintradar.dev/rules/eslint/no-magic-numbers.md): Disallow magic numbers

---

Web page: https://lintradar.dev/rules/eslint/multiline-comment-style. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
