Run ESLint as Mocha tests without a task runner like Grunt or Gulp. Version 7.0.0 supports ESLint ^7.0.0 and requires Node ^10.12.0 or >=12.0.0. It creates separate Mocha tests for each linted path or glob pattern, with options for formatter, timeout, slow, strict mode, and context name. Unlike alternatives that require plugin registration, this package directly exposes a function to run linting in any Mocha test file.
npm install mocha-eslintVerified import paths — ran on the pinned version, not inferred.
Configure mocha-eslint with paths, formatter style, timeout, and strict mode, then run linting as Mocha tests.
Review ESLint 7 migration guide for rule and config changes.
Use Node >=8.0.0. Update ESLint config for version 6 changes.
Ensure Node >=6.0.0. Review ESLint 5 migration.
Install mocha as a devDependency: npm install --save-dev mocha.
Place negation patterns after all positive patterns in the array.
Run npm install eslint --save-dev
Use const lint = require('mocha-eslint');Set the timeout option in mocha-eslint or globally in Mocha.