Skip to main content

Require JSDoc Since

Require a @since tag in every JSDoc block to track when declarations were introduced.

Summary

The require-jsdoc-since rule reports any JSDoc block on a class, method, property, function, type alias, interface, or enum that is missing a @since tag.

This ensures every declaration records the version in which it was introduced, making it easy to track API evolution.

Why Use This Rule?

  1. Provides a version history directly in source code so contributors know when each declaration was added.
  2. Makes it possible to generate changelogs and migration guides from @since tags.
  3. Catches new declarations that were added without recording a version.

Examples

Configuration

Options

warning

ignoreFiles is an escape hatch for files where this rule genuinely does not apply. It is not intended for routine use.

OptionTypeDefaultDescription
ignoreFilesstring[][]File patterns to skip.

Autofix

Autofix is not available for this rule. Flagged code must be updated manually.

Troubleshooting

  • Warning fires on declarations without JSDoc — The rule only checks declarations that already have a JSDoc block. If a declaration has no JSDoc comment at all, the rule does not report it.
  • Checked node types — The rule checks classes, methods, properties, functions, type aliases, interfaces, and enums. Other node types like variable declarations are not checked.
  • The @since value format is not validated — The rule only checks for the presence of @since. It does not enforce a specific version format (e.g., semver).