Skip to main content

Project banner

lint-my-lines

lint-my-lines is an ESLint plugin that enforces quality standards for code comments. 24 rules covering formatting, content quality, JSDoc/TSDoc validation, accessibility, and advanced analysis--because if your code is linted, your comments should be too.

The Problem It Solves

Code comments are the most under-maintained part of most codebases. Developers run linters on their code, formatters on their syntax, type checkers on their types, and then write comments that are outdated, inconsistent, redundant, or actively misleading. Commented-out code accumulates like sediment. TODO items age into geological artifacts. JSDoc annotations drift out of sync with the functions they describe.

A code comment under the magnifying glass — three rules triggered on sloppy comments.

Nobody reviews comments during code review. Not really. lint-my-lines treats them as first-class citizens that deserve the same automated quality enforcement as the code they're attached to.

What It Does

Comment formatting rules enforce consistent capitalization, punctuation, line length, and whitespace. Content quality rules detect commented-out code (which should be deleted, not preserved like a fossil), flag redundant comments that restate the code, and catch placeholder text that was never filled in.

The full rule grid: 24 lint rules, 19 active, 5 disabled — configurable per project.

TODO and FIXME annotations get formatting standards and aging warnings. A TODO from 18 months ago isn't a plan. It's a lie.

JSDoc/TSDoc validation verifies that documentation annotations actually match the function signatures, parameter types, and return types they claim to describe. Stale comment detection goes further--identifying comments likely to be out of date based on surrounding code changes. This is the hardest problem in comment quality: comments that were accurate when written but quietly stopped being true.

The plugin works with TypeScript, JSX/TSX, Vue, Svelte, and Markdown code blocks. Four configuration presets (Minimal, Recommended, Strict, Analysis) plus an Accessibility preset focused on making comments readable for developers using screen readers.

Before and after: sloppy comments with warnings on the left, clean comments with checkmarks on the right.

Technology

  • Language: JavaScript/TypeScript
  • Platform: ESLint plugin (npm)
  • Distribution: npm, CLI, standalone binaries (Windows, macOS, Linux)
  • Autofix: Many rules support automatic correction
  • License: MIT

How It Connects

lint-my-lines is the documentation-first philosophy applied to the smallest unit of documentation: the inline comment. If the thesis behind this site is that clear writing produces better outcomes, then that applies as much to a three-word comment above a function as it does to a 50-page design specification. The same principles that make Lexichord care about terminology consistency in a style guide make lint-my-lines care about formatting consistency in a codebase.

Where to Find It