Skip to content

TypeScript · maintainability

no-long-comment

eslint:no-long-comment

Flag unusually large unstructured JSDoc blocks in implementation code.

Default
error
Fix
none
Languages
typescript

Why

Large narrative comments become stale and obscure the local facts that belong beside the code.

Fix

Keep only durable local constraints and express the remaining behavior in code.

Before / after

Executed by this rule’s unit tests.

Before

Avoid an unstructured prose wall

src/chart.ts · focus
/** One. Two. Three. Four. Five. Six. Seven. Eight. */
const chart = createChart();

After

Keep a concise local fact

src/cache.ts · focus
// The cache is process local.
const cache = new Map();

Limits

  • Only JSDoc blocks are inspected; structured API docs, tests, scripts, generated files, and versioned dependencies are excluded.

Message IDs

tooLong