Skip to main content
GitHub

Justify-disable

Justify-disable is a CLI and JavaScript API that fails the build when an eslint-disable or stylelint-disable directive has no written @todo <reason> comment directly above it. A reason can carry a condition that expires it on a date, a version or a dependency change. It reads files with git, so it runs without ESLint or Stylelint installed.

Content is verified against @ladamczyk/justify-disable v1.0.1. See CHANGELOG.md to verify accuracy.

Why​

Suppressions without a stated reason rot: nobody remembers why a rule was switched off, so nobody dares to switch it back on. AI coding agents make this worse, because adding a disable comment is the quickest way to make a lint error go away. It turns every suppression into a decision someone wrote down, and lets that decision expire.

// @todo [2030-01-01] Legacy SDK returns any; type it after the v3 upgrade.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const response: any = await legacyCall();

It is heavily inspired by unicorn's expiring-todo-comments. See The rule for what counts as a reason and Todo conditions for expiry.

Install​

npm install --save-dev @ladamczyk/justify-disable
npx justify-disable

or run it without installing:

npx @ladamczyk/justify-disable

It needs Node ^22.22.2, ^24.15.0 or >=26, npm 10 or later, and a git repository (or a custom provider).

Compared with ESLint rules​

What you getjustify-disableeslint-comments/require-descriptionunicorn/expiring-todo-comments
Requires a reason for lint disablesyes, a @todo comment on the line aboveyes, after -- in the same commentno, it checks TODO comments
Stylelint directivesyesnono
Reason expiresdate, own version, engine, dependency added, removed or rangednoyes, for TODO comments
Custom directives (@ts-ignore, …)yes, through tools configyes, through additionalDirectivesno
Needs ESLintnoyesyes

The ESLint rules are good choices when ESLint already runs everywhere, and Stylelint's own reportDescriptionlessDisables option requires a -- reason on Stylelint disables. Reach for this one when you want a single check across ESLint and Stylelint directives, outside the linters, with reasons that expire. Alternatives compares every option, built-ins included, and says when you don't need this tool.

Use it as a gate​

Changelog​

Release history lives in the repo — CHANGELOG.md.