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.
An array of characters to ignore at the start of comments when location is "start". Useful for ignoring common comment decorations like * in JSDoc-style comments.
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:
Options
This rule has an options object with the following defaults:
termsAn array of terms to match. The matching is case-insensitive.
locationWhere to check for the terms:
"start"(default): Terms must appear at the start of the comment (after any decoration)"anywhere": Terms can appear anywhere in the commentdecorationAn array of characters to ignore at the start of comments when
locationis"start". Useful for ignoring common comment decorations like*in JSDoc-style comments.How to use
To enable this rule in the CLI or using the config file, you can use:
References