eslint-plugin-mocha weekly downloads statistics
By lo1tuma · npm · ESLint plugins
Eslint rules for mocha.
eslint-plugin-mocha has 799,704 recorded weekly downloads on npm, a decrease of 54.7% over the past 30 days, ranking #210 of 2,322 tracked listings.
About eslint-plugin-mocha
eslint-plugin-mocha
ESLint rules for Mocha.
This plugin targets Mocha's current JavaScript interfaces documented for Mocha 11. It does not execute Mocha or require Mocha at runtime.
Install
This plugin requires ESLint 10.2.0 or later.
npm install --save-dev eslint-plugin-mocha
Configure
Use the plugin with ESLint's flat config. Apply it only to Mocha test files, and adjust files to match your project:
import mochaPlugin from 'eslint-plugin-mocha';
export default [
{
files: [ 'test/**/*.js' ],
...mochaPlugin.configs.recommended
}
];
Configs
mochaPlugin.configs.recommended: Practical defaults for most projects.mochaPlugin.configs.all: Enables every rule. This config may change when new rules are added, so it is better suited for trying the full rule set than for stable long-term lint output.
import mochaPlugin from 'eslint-plugin-mocha';
export default [
{
files: [ 'test/**/*.js' ],
...mochaPlugin.configs.all
}
];
Plugin settings
These settings are shared by multiple rules.
additionalCustomNames: Adds custom suite, test, or hook function names. This is useful for Mocha wrappers such asember-mocha,mocha-each, or project-specific helpers that wrap setup and teardown. Useinterface: "require"for wrappers that expose named imports from a helper module instead of importing directly frommocha.
{
"rules": {
"mocha/no-pending-tests": "error",
"mocha/no-exclusive-tests": "error"
},
"settings": {
"mocha/additionalCustomNames": [
{
"name": "describeModule",
"type": "suite",
"interface": "BDD"
},
{
"name": "testModule",
"type": "testCase",
"interface": "TDD"
},
{
"name": "prepareTestContexts",
"type": "hook",
"interface": "BDD"
}
]
}
}
The name field supports these forms:
- Plain name, such as
describeModule:
describeModule('example', function () {});
- Dotted name, such as
describe.modifier:
describe.modifier('example', function () {});
- Name with parentheses, such as
forEach().describe:
forEach([ 1, 2, 3 ]).describe('example', function (n) {});
- Combination, such as
forEach().describeModule.modifier:
forEach([ 1, 2, 3 ]).describeModule.modifier('example', function (n) {});
type: Selectssuite,testCase, orhook.interface: SelectsBDD,TDD, orrequire. The default isBDD. Withrequire, rule resolution uses namedimportstatements instead of globals.mocha/consistent-interfacealso reports named imports of Mocha interface methods when this setting isBDDorTDD, which helps catch accidentalrequire-style usage and interface misconfiguration earlier.
The plugin supports Mocha's BDD, TDD, and Require interfaces. It does not support Mocha's Exports or QUnit interfaces, or third-party UIs with different syntax. Many rules depend on suite, test, and hook calls being represented as nested call expressions, which those interfaces do not provide consistently.
For wrapper APIs that still expose suite, test, or hook call functions, use additionalCustomNames.
Rules
For maintainers: the rules table below is generated, and the headers in documentation/rules/*.md are partly generated. Refresh them with npx just update-eslint-docs. Run mutation testing with npx just test-mutation.
💼 Configurations enabled in.
⚠️ Configurations set to warn in.
🚫 Configurations disabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.…
Description from the npm listing.
- eslint
- eslintplugin
- eslint-plugin
- mocha
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (544)Similar npm ESLint plugins plugins
All 20 eslint-plugin-mocha alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-mocha. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.