---
title: comment-one-sentence-per-line
description: Enforce one sentence per comment line, collapse simple block comments to one line, and optionally require ending punctuation.
---

- Rule ID: `tai-kun/comment-one-sentence-per-line`
- Auto-fix: Partial (line joins and single-line block comments)

Joins sentences that wrap across several comment lines. Simple `/** */` block comments without JSDoc tags that contain a single sentence are collapsed to one line. When `requireEndPunctuation` is enabled, prose lines that do not end with punctuation such as `。` or `.` are also reported. Lines ending with `:` or `：` are treated as sentence ends.

## Configuration [#configuration]

Add the rule to `lint.rules` in `vite.config.ts` to enable it.

```ts
"tai-kun/comment-one-sentence-per-line": ["error", { requireEndPunctuation: true }],
```

## Options [#options]

| Option                  | Type      | Default | Description                                                     |
| ----------------------- | --------- | ------- | --------------------------------------------------------------- |
| `requireEndPunctuation` | `boolean` | `false` | Require ending punctuation on the last prose line of a comment. |

## Examples [#examples]

### Invalid [#invalid]

```ts
// This is a sentence that
// wraps across two lines
```

```ts
/**
 * This is a sentence.
 */
```

### Valid [#valid]

```ts
// This is a sentence that wraps across two lines.
```

```ts
/** This is a sentence. */
```

## Notes [#notes]

- Directives, JSDoc tags, lists, code, code fences, and `@example` blocks are ignored.
- Lines ending with `:` or `：` (such as label lines) are treated as sentence ends and are not joined with the next line.
- Simple block comments without JSDoc tags are collapsed to a single `/** ... */` line when they contain only one sentence. Comments with multiple sentences or blank lines are left unchanged.
- Line joins and block comment collapsing are auto-fixed, but missing ending punctuation is not.
- `requireEndPunctuation` defaults to `false`.

## Related rules [#related-rules]

- [`spaced-comment`](/vp-lint-plugins/en/rules/spaced-comment)
- [`comment-japanese-spacing`](/vp-lint-plugins/en/rules/comment-japanese-spacing)
