talira

eslint-plugin-mocha

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.

  1. eslint-plugin-jest ESLint rules for Jest tests
  2. eslint-plugin-vue The official ESLint plugin for Vue.js
  3. angular-eslint ESLint support, rules and tooling for Angular projects
  4. ESLint Find and fix problems in your JavaScript code.
  5. typescript-eslint The tooling that lets ESLint and Prettier lint and read TypeScript
  6. Oxc The JavaScript Oxidation Compiler: high-performance JavaScript and TypeScript tools in Rust

Compare eslint-plugin-mocha with the top 3