# eslint-plugin-ava

> ESLint rules for AVA

Latest version **17.0.1** (published 2026-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-ava
pnpm add eslint-plugin-ava
yarn add eslint-plugin-ava
bun add eslint-plugin-ava
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 17.0.1 |
| Published | 2026-06-13 |
| First published | 2016-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 6 |
| Unpacked size | 149.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 234 |
| Maintainers | sindresorhus, novemberborn |
| Keywords | eslint, eslintplugin, eslint-plugin, ava, test, runner, assert, asserts, assertion, mocha |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-ava
- Repository: https://github.com/avajs/eslint-plugin-ava
- Homepage: https://github.com/avajs/eslint-plugin-ava#readme
- Issues: https://github.com/avajs/eslint-plugin-ava/issues
- npm.io page: https://npm.io/package/eslint-plugin-ava

## Dependencies (6)

- [espree](https://npm.io/package/espree.md) ^11.2.0
- [espurify](https://npm.io/package/espurify.md) ^3.2.0
- [@eslint/json](https://npm.io/package/@eslint/json.md) ^2.0.0
- [resolve-from](https://npm.io/package/resolve-from.md) ^5.0.0
- [micro-spelling-correcter](https://npm.io/package/micro-spelling-correcter.md) ^1.1.1
- [@eslint-community/eslint-utils](https://npm.io/package/@eslint-community/eslint-utils.md) ^4.9.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 17.0.1 (latest) — 2026-06-13
- 7.0.0-rc.1 (next) — 2019-05-28
- 17.0.0 — 2026-05-20
- 16.0.1 — 2026-04-06
- 16.0.0 — 2026-02-10
- 15.1.0 — 2025-07-18
- 15.0.1 — 2024-05-11
- 15.0.0 — 2024-05-03
- 14.0.0 — 2023-01-18
- 13.2.0 — 2022-01-08
- 13.1.0 — 2021-10-22
- 13.0.0 — 2021-09-18
- 12.0.0 — 2021-03-24
- 11.0.0 — 2020-08-16
- 10.5.0 — 2020-07-26
- … 49 more at https://npm.io/package/eslint-plugin-ava/versions

## README

# eslint-plugin-ava [![Coverage Status](https://coveralls.io/repos/github/avajs/eslint-plugin-ava/badge.svg?branch=main)](https://coveralls.io/github/avajs/eslint-plugin-ava?branch=main)

> ESLint rules for [AVA](https://avajs.dev)

Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/readme.md)

This plugin is bundled in [XO](https://github.com/xojs/xo). No need to do anything if you're using it.

[**Propose or contribute a new rule ➡**](.github/contributing.md)

## Install

```sh
npm install --save-dev eslint eslint-plugin-ava
```

**Requires ESLint `>=10`, [flat config](https://eslint.org/docs/latest/use/configure/configuration-files), and [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).**

## Usage

Use a [preset config](#recommended-config) or configure each rule in `eslint.config.js`.

```js
import eslintPluginAva from 'eslint-plugin-ava';

export default [
	{
		plugins: {
			ava: eslintPluginAva,
		},
		rules: {
			'ava/assertion-arguments': 'error',
			'ava/no-only-test': 'error',
		},
	},
];
```

## Rules

The rules will only activate in test files.

<!-- begin auto-generated rules list -->

💼 [Configurations](https://github.com/avajs/eslint-plugin-ava#recommended-config) enabled in.\
⚠️ [Configurations](https://github.com/avajs/eslint-plugin-ava#recommended-config) set to warn in.\
🚫 [Configurations](https://github.com/avajs/eslint-plugin-ava#recommended-config) disabled in.\
✅ Set in the `recommended` [configuration](https://github.com/avajs/eslint-plugin-ava#recommended-config).\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\
❌ Deprecated.

| Name                                                                 | Description                                                                                                    | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | ❌  |
| :------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- | :- |
| [assertion-arguments](docs/rules/assertion-arguments.md)             | Enforce passing correct arguments to assertions.                                                               | ✅  |    |    | 🔧 |    |    |
| [failing-test-url](docs/rules/failing-test-url.md)                   | Require a URL in a comment above `test.failing()`.                                                             |    |    | ✅  |    |    |    |
| [hooks-order](docs/rules/hooks-order.md)                             | Enforce test hook ordering.                                                                                    | ✅  |    |    | 🔧 |    |    |
| [max-asserts](docs/rules/max-asserts.md)                             | Limit the number of assertions in a test.                                                                      |    |    | ✅  |    |    |    |
| [no-async-fn-without-await](docs/rules/no-async-fn-without-await.md) | Require async tests to use `await`.                                                                            | ✅  |    |    |    | 💡 |    |
| [no-ava-in-dependencies](docs/rules/no-ava-in-dependencies.md)       | Disallow AVA in `dependencies`.                                                                                | ✅  |    |    | 🔧 |    |    |
| [no-commented-tests](docs/rules/no-commented-tests.md)               | Disallow commented-out tests.                                                                                  |    | ✅  |    |    |    |    |
| [no-conditional-assertion](docs/rules/no-conditional-assertion.md)   | Disallow assertions inside conditional statements.                                                             | ✅  |    |    |    |    |    |
| [no-duplicate-hooks](docs/rules/no-duplicate-hooks.md)               | Disallow duplicate hook declarations.                                                                          | ✅  |    |    |    |    |    |
| [no-duplicate-modifiers](docs/rules/no-duplicate-modifiers.md)       | Disallow duplicate test modifiers.                                                                             |    |    | ✅  | 🔧 |    | ❌  |
| [no-identical-title](docs/rules/no-identical-title.md)               | Disallow identical test titles.                                                                                | ✅  |    |    |    |    |    |
| [no-ignored-test-files](docs/rules/no-ignored-test-files.md)         | Disallow tests in ignored files.                                                                               | ✅  |    |    |    |    |    |
| [no-import-test-files](docs/rules/no-import-test-files.md)           | Disallow importing test files.                                                                                 | ✅  |    |    |    |    |    |
| [no-incorrect-deep-equal](docs/rules/no-incorrect-deep-equal.md)     | Disallow using `deepEqual` with primitives.                                                                    | ✅  |    |    | 🔧 |    |    |
| [no-inline-assertions](docs/rules/no-inline-assertions.md)           | Disallow inline assertions.                                                                                    | ✅  |    |    | 🔧 |    |    |
| [no-invalid-modifier-chain](docs/rules/no-invalid-modifier-chain.md) | Disallow invalid modifier chains.                                                                              | ✅  |    |    | 🔧 | 💡 |    |
| [no-negated-assertion](docs/rules/no-negated-assertion.md)           | Disallow negated assertions.                                                                                   | ✅  |    |    | 🔧 |    |    |
| [no-nested-assertions](docs/rules/no-nested-assertions.md)           | Disallow nested assertions.                                                                                    | ✅  |    |    |    |    |    |
| [no-nested-tests](docs/rules/no-nested-tests.md)                     | Disallow nested tests.                                                                                         | ✅  |    |    |    |    |    |
| [no-only-test](docs/rules/no-only-test.md)                           | Disallow `test.only()`.                                                                                        | ✅  |    |    |    | 💡 |    |
| [no-skip-assert](docs/rules/no-skip-assert.md)                       | Disallow skipping assertions.                                                                                  | ✅  |    |    |    | 💡 |    |
| [no-skip-test](docs/rules/no-skip-test.md)                           | Disallow skipping tests.                                                                                       | ✅  |    |    |    | 💡 |    |
| [no-todo-implementation](docs/rules/no-todo-implementation.md)       | Disallow giving `test.todo()` an implementation function.                                                      | ✅  |    |    |    | 💡 |    |
| [no-todo-test](docs/rules/no-todo-test.md)                           | Disallow `test.todo()`.                                                                                        |    | ✅  |    |    | 💡 |    |
| [no-unknown-modifiers](docs/rules/no-unknown-modifiers.md)           | Disallow unknown test modifiers.                                                                               |    |    | ✅  |    | 💡 | ❌  |
| [no-useless-t-pass](docs/rules/no-useless-t-pass.md)                 | Disallow useless `t.pass()`.                                                                                   | ✅  |    |    |    |    |    |
| [prefer-async-await](docs/rules/prefer-async-await.md)               | Prefer async/await over returning a Promise.                                                                   | ✅  |    |    |    |    |    |
| [prefer-power-assert](docs/rules/prefer-power-assert.md)             | Enforce using only assertions compatible with [power-assert](https://github.com/power-assert-js/power-assert). |    |    | ✅  |    |    |    |
| [prefer-t-regex](docs/rules/prefer-t-regex.md)                       | Prefer `t.regex()` over `RegExp#test()` and `String#match()`.                                                  | ✅  |    |    | 🔧 |    |    |
| [prefer-t-throws](docs/rules/prefer-t-throws.md)                     | Prefer `t.throws()` or `t.throwsAsync()` over try/catch.                                                       | ✅  |    |    |    |    |    |
| [require-assertion](docs/rules/require-assertion.md)                 | Require that tests contain at least one assertion.                                                             | ✅  |    |    |    |    |    |
| [test-title](docs/rules/test-title.md)                               | Require tests to have a title.                                                                                 | ✅  |    |    | 🔧 |    |    |
| [test-title-format](docs/rules/test-title-format.md)                 | Require test titles to match a pattern.                                                                        |    |    | ✅  |    |    |    |
| [use-t](docs/rules/use-t.md)                                         | Require test functions to use `t` as their parameter.                                                          | ✅  |    |    |    |    |    |
| [use-t-throws-async-well](docs/rules/use-t-throws-async-well.md)     | Require `t.throwsAsync()` and `t.notThrowsAsync()` to be awaited.                                              | ✅  |    |    | 🔧 |    |    |
| [use-t-well](docs/rules/use-t-well.md)                               | Disallow incorrect use of `t`.                                                                                 | ✅  |    |    | 🔧 |    |    |
| [use-test](docs/rules/use-test.md)                                   | Require AVA to be imported as `test`.                                                                          | ✅  |    |    |    |    |    |
| [use-true-false](docs/rules/use-true-false.md)                       | Prefer `t.true()`/`t.false()` over `t.truthy()`/`t.falsy()`.                                                   | ✅  |    |    | 🔧 |    |    |

<!-- end auto-generated rules list -->

## Recommended config

This plugin exports a [`recommended` config](index.js) that enforces good practices.

```js
import eslintPluginAva from 'eslint-plugin-ava';

export default [
	...eslintPluginAva.configs.recommended,
];
```

---
_Source: https://npm.io/package/eslint-plugin-ava · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
