npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-forbidden-comments

v0.0.1

Published

ESLint plugin to disallow comment blocks — prevents comments from leaking into production code and prevents LLMs from over commenting code.

Readme

eslint-plugin-forbidden-comments

Prevents leaving comment blocks in source files. Designed for projects where comments should not reach production — e.g. when code is not processed by a bundler.

Why?

Without a bundler stripping comments, notes, commented-out code blocks, or sensitive information can leak into production.

LLM-generated code

LLMs produce excessive, low-value comments (// initialize the array, // return the result, // handle error). Prompt instructions like "don't write comments" work initially, but LLM context windows are finite -- when the conversation grows long enough to trigger memory compaction, those instructions are among the first to be discarded, and the LLM reverts to its default commenting habits. An ESLint rule is a hard constraint that cannot be forgotten, compacted away, or ignored. Every comment triggers a lint error that the LLM must resolve by making the code self-documenting instead.

Installation

npm install --save-dev eslint-plugin-forbidden-comments
# or
pnpm add -D eslint-plugin-forbidden-comments

Usage

ESLint 9 flat config

import forbiddenComments from "eslint-plugin-forbidden-comments";

export default [
	{
		plugins: { "forbidden-comments": forbiddenComments },
		rules: {
			"forbidden-comments/disallowComments": "error",
		},
	},
];

Options

All options default to true (allowed). Set to false to explicitly forbid that comment type.

"forbidden-comments/disallowComments": ["error", {
  allowJSDoc: true,               // /** ... */ — allowed by default
  allowTODO: true,                // // TODO: ... — allowed by default
  allowFIXME: true,               // // FIXME: ... — allowed by default
  allowSvelteHTMLComments: true,  // <!-- ... --> in .svelte files — allowed by default
  allow: ["eslint", "global"],    // custom regex patterns — always checked
}]

allowJSDoc

When true (default), block comments starting with * are allowed:

/** This JSDoc comment is allowed */
function greet(name) {}

Set to false to forbid JSDoc comments too.

allowTODO

When true (default), comments matching TODO: (case-insensitive) are allowed in both line and block style:

// TODO: fix this later
/* TODO: refactor */

allowFIXME

When true (default), comments matching FIXME: (case-insensitive) are allowed:

// FIXME: broken on edge case

allowSvelteHTMLComments

When true (default), HTML comments in Svelte templates are allowed:

<!-- This section renders the hero -->
<section>...</section>

Set to false to forbid them:

"forbidden-comments/disallowComments": ["error", { allowSvelteHTMLComments: false }]

allow

Array of regex pattern strings. A comment matching any pattern is allowed. Defaults to permitting eslint and global directive comments regardless of this option.

{
	allow: ["eslint", "global", "copyright"];
}

Rule details

Fail

// import { foo } from './foo'
const { foo } = require("./foo");
/* var price1 = 5;
 * var price2 = 6;
 */
const client = require("cool-package"); // TO-DO fix vulnerability
<!-- TODO this would pass since allowTODO defaults to true -->
<!-- but this plain comment would fail -->
<div>...</div>

Pass

// eslint-disable-next-line no-unused-vars
/* global MyClass */
/** @param {string} name */
function greet(name) {}
// TODO: address before release
// FIXME: edge case on Safari

MIT License