You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
noComments: a global lint rule against AI-generated comment pollution
#13183
AI coding assistants have made comment pollution a first-class linting problem. Generated code routinely arrives with mechanism-explaining comments (// increment the counter, // this ensures the cache is warm) that duplicate what the code already says. A growing number of teams respond with explicit "zero-comment" policies: if the code needs a paragraph to explain itself, that paragraph belongs in a design doc or the commit message — not the source file.
Biome currently cannot express that policy at all:
noCommentText only flags comment-shaped text inside JSX children; real comments pass.
useSingleJsDocAsterisk only enforces JSDoc style.
No rule is configurable toward "disallow comments".
Proposal
A noComments rule (grouping/name up for discussion) that reports every comment node, in every file Biome lints — this is inherently a global, cross-file check, which is exactly why it belongs in the linter rather than in review checklists.
// Invalid// fetch the user profileconstuser=awaitgetUser(id)/* retry three times */for(leti=0;i<3;i++){ ... }/** Returns the user. */functiongetUser(){}// Valid (always exempt)// biome-ignore lint/suspicious/noDoubleEquals: intentional demoa==b/// <reference types="vite/client" />
Not every team wants an absolute ban, so a minimal option surface would widen adoption:
allowKinds: e.g. ["line"] / ["block"] / ["jsdoc"]
allowPatterns: escape hatch for tagged comments such as ^NOTE:
allowBiomeDirectives: default true
Defaults should keep the rule a strict zero-comment gate — that is what AI-heavy teams need.
An unsafe fix that removes the comment would make biome check --write a one-shot sweep for cleaning up an AI-polluted codebase.
Why this must be a native rule
Comments are trivia, and both plugin surfaces provably cannot reach them today:
JavaScript plugins (2.6+): the native→JS bridge strips trivia — childrenWithTokens() never yields COMMENT tokens, and the token handle exposes only kind | parent | text.
The Rust analyzer already has a comments service (useSingleJsDocAsterisk runs on it), so the infrastructure exists — it is just not reachable from userland.
Prior art
ESLint's no-inline-comments and no-warning-comments are both partial; neither bans comments wholesale. Teams wanting a total ban currently maintain hand-rolled AST scripts — a native rule with an unsafe fix would replace all of that.
Scope-wise: JavaScript/TypeScript/JSX first; CSS and GraphQL are natural follow-ups since their grammars already model comments.
If Discussions › Ideas is the preferred venue for this kind of proposal, happy to relocate — keeping it as an issue for now for visibility.
This discussion was converted from issue #13179 on November 14, 2026 15:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
AI coding assistants have made comment pollution a first-class linting problem. Generated code routinely arrives with mechanism-explaining comments (
// increment the counter,// this ensures the cache is warm) that duplicate what the code already says. A growing number of teams respond with explicit "zero-comment" policies: if the code needs a paragraph to explain itself, that paragraph belongs in a design doc or the commit message — not the source file.Biome currently cannot express that policy at all:
noCommentTextonly flags comment-shaped text inside JSX children; real comments pass.useSingleJsDocAsteriskonly enforces JSDoc style.Proposal
A
noCommentsrule (grouping/name up for discussion) that reports every comment node, in every file Biome lints — this is inherently a global, cross-file check, which is exactly why it belongs in the linter rather than in review checklists.Not every team wants an absolute ban, so a minimal option surface would widen adoption:
allowKinds: e.g.["line"]/["block"]/["jsdoc"]allowPatterns: escape hatch for tagged comments such as^NOTE:allowBiomeDirectives: defaulttrueDefaults should keep the rule a strict zero-comment gate — that is what AI-heavy teams need.
An unsafe fix that removes the comment would make
biome check --writea one-shot sweep for cleaning up an AI-polluted codebase.Why this must be a native rule
Comments are trivia, and both plugin surfaces provably cannot reach them today:
childrenWithTokens()never yieldsCOMMENTtokens, and the token handle exposes onlykind | parent | text.The Rust analyzer already has a comments service (
useSingleJsDocAsteriskruns on it), so the infrastructure exists — it is just not reachable from userland.Prior art
ESLint's
no-inline-commentsandno-warning-commentsare both partial; neither bans comments wholesale. Teams wanting a total ban currently maintain hand-rolled AST scripts — a native rule with an unsafe fix would replace all of that.Scope-wise: JavaScript/TypeScript/JSX first; CSS and GraphQL are natural follow-ups since their grammars already model comments.
If Discussions › Ideas is the preferred venue for this kind of proposal, happy to relocate — keeping it as an issue for now for visibility.
All reactions