ESLint rules for Mocha test suites
open sourceMITfree
eslint-plugin-mocha adds ESLint rules for Mocha test files, targeting Mocha 11's JavaScript interfaces, without running or requiring Mocha. It works with ESLint's flat config (ESLint 10.2 or later) and is applied only to test files. It's by Mathias Schreck.
Problems it solves
- lint Mocha test files with ESLint
- catch exclusive or skipped Mocha tests left in code
- enforce Mocha test conventions in CI
Features
- ESLint rules for Mocha 11 interfaces
- flat config support
- no Mocha runtime dependency
Alternatives
The same job
These do what eslint-plugin-mocha does.
- eslint-plugin-jest ESLint rules for Jest tests
- eslint-plugin-vue The official ESLint plugin for Vue.js
- angular-eslint ESLint support, rules and tooling for Angular projects
- ESLint Find and fix problems in your JavaScript code.
- typescript-eslint The tooling that lets ESLint and Prettier lint and read TypeScript
- Oxc The JavaScript Oxidation Compiler: high-performance JavaScript and TypeScript tools in Rust
