# no-warning-comments

Rule `eslint/no-warning-comments`. Disallow specified warning terms in comments

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 2.5M weekly downloads of presets that enable it
- Trend: +97.4% last quarter
- Rank: #1483 by reach, #268 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-warning-comments` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-warning-comments) |
| Oxlint | `no-warning-comments` | no | no | plugin `eslint`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-warning-comments.html) |

## Code examples

### Incorrect: the rule reports this

```js
/*
FIXME
*/
function callback(err, results) {
  if (err) {
    console.error(err);
    return;
  }
  // TODO
}
```

```js
// TODO: this
// todo: this too
// Even this: TODO
/*
 * The same goes for this TODO comment
 * Or a fixme
 * as well as any other term
 */
```

```js
//***** todo decorative asterisks are ignored *****//
/**
 * TODO new lines and asterisks are also ignored in block comments.
 */
```

### Correct: the rule accepts this

```js
function callback(err, results) {
  if (err) {
    console.error(err);
    return;
  }
  // NOT READY FOR PRIME TIME
  // but too bad, it is not a predefined warning term
}
```

```js
// This is to do
// even not any other    term
// any other terminal
/*
 * The same goes for block comments
 * with any other interesting term
 * or fix me this
 */
```

```js
//!TODO preceded by non-decoration character
/**
 *!TODO preceded by non-decoration character in a block comment
 */
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-warning-comments": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-warning-comments": "error"
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [eslint/no-restricted-imports](https://lintradar.dev/rules/eslint/no-restricted-imports.md): Disallow specified modules when loaded by `import`
- [eslint/func-name-matching](https://lintradar.dev/rules/eslint/func-name-matching.md): Require function names to match the name of the variable or property to which they are assigned
- [eslint/no-eq-null](https://lintradar.dev/rules/eslint/no-eq-null.md): Disallow `null` comparisons without type-checking operators
- [eslint/prefer-named-capture-group](https://lintradar.dev/rules/eslint/prefer-named-capture-group.md): Enforce using named capture group in regular expression
- [eslint/no-implicit-globals](https://lintradar.dev/rules/eslint/no-implicit-globals.md): Disallow declarations in the global scope
- [eslint/no-negated-condition](https://lintradar.dev/rules/eslint/no-negated-condition.md): Disallow negated conditions

---

Web page: https://lintradar.dev/rules/eslint/no-warning-comments. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
