expiring-todo-comments
UnreleasedConfiguration
Rule details
Reports TODO comments when their expiration conditions are met.
This rule checks TODO, FIXME, and XXX comments, ignoring case. Each condition
that is met produces a separate diagnostic. It does not offer fixes or suggestions.
Conditions
Version comparisons support > and >=, including partial versions and
prereleases. For example, >1 means version 2 or later, while >1.0.0 includes
1.0.1. Peer dependency ranges such as ^8 || ^9 use their lowest supported
version, 8.0.0 in this example. Dependency and engine comparisons use the first
coercible version in their declaration. Dependency version checks report
catalog: references as unsupported; presence checks still work.
Separate conditions with commas. Multiple dates or multiple package-version
conditions on the same line are reported regardless of checkDates.
Options
With allowWarningComments: false, an ordinary // TODO: Add tests reports too.
Warning terms can appear anywhere in the comment. Block-comment lines are checked
individually, and their diagnostics highlight the enclosing comment.
Package conditions require a readable package.json in the working directory or one of its parents. Comparisons use the package.json nearest the linted file.
Differences from upstream
checkDatesOnPullRequestsis unsupported. Its value is accepted for configuration compatibility but ignored. For example, withcheckDates: trueandcheckDatesOnPullRequests: false, expired dates still report. SetcheckDates: falseto disable these diagnostics.- Write
ignoreentries as pattern strings. JavaScriptRegExpobjects do not work as ignore patterns. For example, replace/issue-\d+/iwith'[iI][sS][sS][uU][eE]-\\d+'to ignore bothISSUE-123andissue-123. - Invalid or unsupported ignore patterns are ignored. For example,
'\\p{Script=Han}+'does not suppress an expired comment containing中, while upstream suppresses it. Use a supported expression such as'[\\u4E00-\\u9FFF]+'for that character range.