Skip to content
← All rules
CommentsComment quality

comments/no-useless-comments

Ordinary comments should add context instead of restating straightforward code, adding generic headings, or narrating obvious actions.

noisemaintenancerestatement
TypeScript
// Increment count.
count += 1;
Finding

Disallow comments with no maintenance value.

Setup

Install the package, register its plugin factory, then enable the rule.

Install the package

pnpm add -D @scruple/comments

Register the plugin

In scruple.config.ts, register the factory under the comments namespace used by the rule ID.

import { comments } from "@scruple/comments";

plugins: {
  "comments": comments(),
},

Enable the rule

"comments/no-useless-comments": "warn"
Package
@scruple/comments
Default threshold
0.9
Minimum confidence
0.7

Released under the MIT License.