npm / eslint-plugin-mocha
eslint-plugin-mocha
What changed in eslint-plugin-mocha 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
13 breaking13 new APIs and options6 behavior and defaults1 tooling8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initeslint-plugin-mocha 1241 changes
Breaking changes 13
The rule now reports imported Mocha interface methods.
ESLint v10.2.0 or later is now required.
The rule now requires done callback handling in every branch.
The setting name changed from exports to require; update configurations using the previous setting name.
The rule was renamed to no-top-level-tests; update configurations that reference the old name.
The rule was renamed to no-hooks-for-single-child; update configurations that reference the old name.
The rule now catches this.skip().
The rule was renamed to no-return-and-done; update configurations that reference the old name.
The rule was renamed to no-setup-in-suite; update configurations that reference the old name.
Its functionality moved into consistent-structure; update configurations that enable the old rule.
The no-synchronous-tests option was renamed to allowedAsyncMethods; update configurations that use the old option.
The rule was renamed to no-root-hooks; update configurations that reference the old name.
The recommended config defaults were adjusted, which may change the rules applied by this config.
New APIs and options 13
A rule for enforcing suite ordering was added.
Custom hook names are now supported.
Custom exports wrapper functions are now supported.
A rule for limiting retry settings was added.
A rule for limiting slow test settings was added.
A rule for limiting timeout settings was added.
A rule forbidding async callbacks that use done was added.
A rule for detecting async operations in synchronous tests was added.
A rule to reject code after done() was added.
A rule for detecting conditional tests was added.
A rule to reject multiple done() calls was added.
A rule for detecting nested suites was added.
An allow option was added to no-setup-in-describe, now named no-setup-in-suite.
Behavior and default changes 6
The rule now supports hook ordering.
Done callback properties can now be handed off.
The rule now covers scheduling APIs.
The rule now provides suggestions.
Commented skips are now allowed.
The rule now provides suggestions.
Tooling 1
The rule now provides suggestions.
Fixes and other changes 8
Fixes the rule for object property callbacks.
Fixes handle-done-callback for nested callback handoffs.
Usage of Mocha interface methods that are not configured is no longer flagged.
An autofix was added.
The rule now handles TypeScript this parameters.
The fixer now guards against await expressions.
Fixed the fixer for commented concise bodies.
Fixed false positives for nested functions.