ESLint plugin providing rules to enforce best practices and catch common errors in AVA test files.
eslint-plugin-ava is an ESLint plugin that provides specialized linting rules for AVA test files. It helps developers write better tests by enforcing AVA-specific best practices, catching common errors, and promoting consistent test code patterns. The plugin automatically validates assertions, test structure, async usage, and prevents anti-patterns like committing `test.only()` calls.
JavaScript developers using AVA as their test runner, particularly those working on projects where test code quality and consistency are important. It's especially valuable for teams wanting to enforce standardized testing practices across their codebase.
Developers choose eslint-plugin-ava because it provides AVA-specific linting that catches testing errors early, enforces consistent patterns, and integrates seamlessly with ESLint workflows. Its comprehensive rule set covers common AVA pitfalls that generic ESLint rules would miss.
ESLint rules for AVA
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes over 30 specific rules for assertions, hooks, and async patterns, as detailed in the rules table, ensuring thorough linting of AVA test code.
Prevents common AVA errors like accidental `test.only()` commits and incorrect use of `deepEqual`, promoting reliable test suites based on AVA's philosophy.
Provides a recommended config and works with ESLint's flat config, simplifying setup as shown in the usage examples for quick adoption.
Many rules, such as `assertion-arguments` and `hooks-order`, are automatically fixable with ESLint's `--fix` option, reducing manual correction time.
Requires ESLint >=10, flat config, and ESM, which can force upgrades in legacy projects, as stated in the install section, adding migration overhead.
Only useful for AVA tests; if a project switches test runners or uses multiple ones, the plugin becomes obsolete, limiting flexibility.
While contributions are encouraged, users cannot easily create custom rules without forking the project, as there's no built-in extensibility mechanism.