# expiring-todo-comments

Rule `unicorn/expiring-todo-comments`. Add expiration conditions to TODO comments.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 9.9M weekly downloads of presets that enable it
- Trend: +28.3% last quarter
- Rank: #915 by reach, #1170 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/expiring-todo-comments` | no | no | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/expiring-todo-comments.md) |

## Code examples

### Incorrect: the rule reports this

```js
// TODO [2000-01-01]: I'll fix this next week.
// TODO [2000-01-01, 2001-01-01]: Multiple dates won't work.

// TODO [>1]: If your package.json version is > 1.
// TODO [>=1]: If your package.json version is >= 1.
// TODO [>1, >2]: Multiple package versions won't work.

// TODO [+read-pkg]: Since we already have it, this reports.
// TODO [-we-dont-have-this-package]: Since we don't have, trigger a report.

// TODO [read-pkg@>1]: When `read-pkg` version is > 1 don't forget to do this.
// TODO [read-pkg@>=5.1.1]: When `read-pkg` version is >= 5.1.1 don't forget to do that.

// TODO [peer:eslint@>=8]: Whoops, our minimum supported `eslint` is already >= 8.

// TODO [engine:node@>=8]: Whoops, we are already supporting it!

// TODO: Add unicorns.
```

### Correct: the rule accepts this

```js
// TODO [2200-12-25]: Too long... Can you feel it?
// FIXME [2200-12-25]: Too long... Can you feel it?

// TODO (lubien) [2200-12-12]: You can add something before the arguments.
// TODO @lubien [2200-12-12]: You can add something before the arguments.
// FIXME [2200-12-25] (lubien): You can add something after the arguments, before the colon.
// TODO [2200-12-12] No colon after argument.

// TODO [+react]: Refactor this when we use React.
// TODO [-lodash]: If we remove lodash we need to change this.

// TODO [lodash@>10]: Lodash has a new way to do this; when we bump to its version let's use it.
// TODO [lodash@>=10]: Lodash has a new way to do this; when we bump to its version let's use it.

// TODO [2200-12-25, +popura, lodash@>10]: Combo.

// TODO [peer:eslint@>=99]: When our minimum supported `eslint` reaches v99.

// TODO [engine:node@>12]: When we bump to this Node version we can use import/export.

/*
 * TODO [2200-12-25]: Yet
 * TODO [2200-12-25]: Another
 * TODO [2200-12-25]: Way
 */
```

Examples from the ESLint documentation.

## Enable it

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

```js
import unicorn from "eslint-plugin-unicorn";

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/expiring-todo-comments": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Unicorn unopinionated](https://lintradar.dev/presets/unicorn-unopinionated.md) | ESLint | `eslint-plugin-unicorn` | 236 | 9.5M | +30.3% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [unicorn/dom-node-dataset](https://lintradar.dev/rules/unicorn/dom-node-dataset.md): Enforce consistent style for DOM element dataset access.
- [unicorn/no-array-from-fill](https://lintradar.dev/rules/unicorn/no-array-from-fill.md): Disallow `.fill()` after `Array.from({length: …})`.
- [unicorn/consistent-optional-chaining](https://lintradar.dev/rules/unicorn/consistent-optional-chaining.md): Enforce consistent optional chaining for same-base member access.
- [unicorn/no-async-iterator-callback](https://lintradar.dev/rules/unicorn/no-async-iterator-callback.md): Disallow asynchronous callbacks in synchronous iterator helpers.
- [unicorn/consistent-export-decorator-position](https://lintradar.dev/rules/unicorn/consistent-export-decorator-position.md): Enforce consistent decorator position on exported classes.
- [unicorn/no-blob-to-file](https://lintradar.dev/rules/unicorn/no-blob-to-file.md): Disallow unnecessary `Blob` to `File` conversion.

---

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