# check-alignment

Rule `jsdoc/check-alignment`. Reports invalid alignment of JSDoc block asterisks.

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```ts
/**
  * @param {Number} foo
 */
function quux (foo) {
  // with spaces
}
```

### Correct: the rule accepts this

```ts
/**
 * Desc
 *
 * @param {Number} foo
 */
function quux (foo) {
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { jsdoc },
    rules: {
      "jsdoc/check-alignment": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [JSDoc recommended](https://lintradar.dev/presets/jsdoc-recommended.md) | ESLint | `eslint-plugin-jsdoc` | 37 | 8.1M | +23.8% |
| [JSDoc recommended for TypeScript](https://lintradar.dev/presets/jsdoc-recommended-typescript.md) | ESLint | `eslint-plugin-jsdoc` | 34 | 8.1M | +23.8% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [jsdoc/require-yields-check](https://lintradar.dev/rules/jsdoc/require-yields-check.md): Ensures that if a `@yields` is present that a `yield` (or `yield` with a value) is present in the function body (or that if a `@next` is present that there is a yield with a return value present).
- [jsdoc/require-param](https://lintradar.dev/rules/jsdoc/require-param.md): Requires that all function parameters are documented with a `@param` tag.
- [jsdoc/require-returns-check](https://lintradar.dev/rules/jsdoc/require-returns-check.md): Requires a return statement in function body if a `@returns` tag is specified in JSDoc comment(and reports if multiple `@returns` tags are present).
- [jsdoc/check-values](https://lintradar.dev/rules/jsdoc/check-values.md): This rule checks the values for a handful of tags: `@version`, `@since`, `@license` and `@author`.
- [jsdoc/multiline-blocks](https://lintradar.dev/rules/jsdoc/multiline-blocks.md): Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.
- [jsdoc/escape-inline-tags](https://lintradar.dev/rules/jsdoc/escape-inline-tags.md): Reports use of JSDoc tags in non-tag positions (in the default "typescript" mode).

---

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