Skip to main content

words

Disallow vague or weak wording in comments.

Targeted pattern scopeโ€‹

This rule targets source-code comments.

What this rule reportsโ€‹

This rule reports weak, vague, or overly wordy phrasing in comments.

Why this rule existsโ€‹

Ambiguous comment language reduces maintainability and leaves intent unclear.

โŒ Incorrectโ€‹

// this probably works
const value = 1;

โœ… Correctโ€‹

// this works for positive integers
const value = 1;

Behavior and migration notesโ€‹

This rule forwards options and behavior to write-good-comments/write-good-comments.

Additional examplesโ€‹

// It should probably maybe work for most inputs.
// โŒ likely reported by write-good-comments checks

// Handles positive integers and returns false for negative values.
// โœ… clearer and more precise

ESLint flat config exampleโ€‹

import etcMisc from "eslint-plugin-etc-misc";

export default [
{
plugins: { "etc-misc": etcMisc },
rules: {
"etc-misc/words": "error",
},
},
];

When not to use itโ€‹

Disable this rule if your team does not want prose-quality checks for comments.

Package documentationโ€‹

Rule catalog ID: R079

Further readingโ€‹

Adoption resourcesโ€‹

  • Start at warning level in CI, then move to error after cleanup.
  • Use focused codemods/autofix batches per package or directory.