Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sindresorhus/eslint-plugin-unicorn/llms.txt
Use this file to discover all available pages before exploring further.
TODO and FIXME comments are easy to forget. This rule lets you attach a structured condition directly to the comment — a date, a package version, a dependency — so ESLint reports the comment automatically when the condition is met.
| Recommended | ✅ recommended · ☑️ unopinionated |
| Fixable | — |
| Suggestions | — |
TODOs without any condition are ignored by default. Set
allowWarningComments: false to also flag bare TODOs (equivalent to eslint/no-warning-comments).Conditions
Conditions are written in square brackets directly after theTODO/FIXME/XXX keyword and separated by commas for combinations.
| Syntax | Triggers when |
|---|---|
[YYYY-MM-DD] | The UTC date has passed |
[>=1.0.0] or [>1.0.0] | package.json version meets the comparison |
[+package-name] | The package is present in dependencies |
[-package-name] | The package has been removed from dependencies |
[package@>=2.0.0] | A dependency reaches that version |
[engine:node@>=18] | package.json engines.node meets the comparison |
Examples
Configuration
eslint.config.js
terms
Type: string[] — Default: ['todo', 'fixme', 'xxx']
The comment keywords to check. When adding a custom term, include the defaults explicitly or they will be dropped.
eslint.config.js
ignoreDates
Type: boolean — Default: false
Skip expiry-date checks entirely. Date argument validation (for example, detecting multiple dates on one TODO) still applies.
ignoreDatesOnPullRequests
Type: boolean — Default: true
Skip expiry-date checks when running inside a pull request. This avoids false positives when a contributor opens a PR after a TODO deadline has passed — the fix should be the maintainer’s responsibility.
allowWarningComments
Type: boolean — Default: true
When false, TODOs without any valid condition are also reported (falling back to eslint/no-warning-comments behavior). Useful if you want a single rule to cover both expiring and plain TODOs.
ignore
Type: Array<string | RegExp> — Default: []
Patterns to skip entirely. Only useful when allowWarningComments is false. Strings are interpreted as regular expressions.
eslint.config.js
date
Type: string (ISO 8601 date) — Default: today’s date
Override the reference date used for expiry-date comparisons. Set to a past date to find very old TODOs, or a future date to preview which TODOs will expire soon.
eslint.config.js