Are you an LLM? You can read better optimized documentation at /docs/guide/usage/linter/rules/eslint/no-warning-comments.md for this page in Markdown format
Developers often add comments like TODO or FIXME to mark incomplete work or areas that need attention. While useful during development, these comments can indicate unfinished code that shouldn't be shipped to production. This rule helps catch such comments before they make it into production code.
eslint/no-warning-comments Pedantic
What it does
Disallows warning comments such as TODO, FIXME, XXX in code.
Why is this bad?
Developers often add comments like TODO or FIXME to mark incomplete work or areas that need attention. While useful during development, these comments can indicate unfinished code that shouldn't be shipped to production. This rule helps catch such comments before they make it into production code.
Examples
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Configuration
This rule accepts a configuration object with the following properties:
decoration
type:
string[]default:
[]An array of characters to ignore at the start of comments when
locationis"start".Useful for ignoring common comment decorations like
*in JSDoc-style comments.location
type:
"start" | "anywhere"default:
"start"Where to check for the terms.
"start"Terms must appear at the start of the comment, after any decoration.
"anywhere"Terms can appear anywhere in the comment.
terms
type:
string[]default:
["todo", "fixme", "xxx"]An array of terms to match. The matching is case-insensitive.
How to use
To enable this rule using the config file or in the CLI, you can use:
Version
This rule was added in v1.24.0.
References