eslint-plugin-ava
ESLint rules for AVA
Last updated 11 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install eslint-plugin-ava 
SYNC missed versions from official npm registry.

eslint-plugin-ava Coverage Status

ESLint rules for AVA

Translations: FranΓ§ais

This plugin is bundled in XO. No need to do anything if you're using it.

Propose or contribute a new rule ➑

Install

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

Usage

Configure it in package.json.

{
	"name": "my-awesome-project",
	"eslintConfig": {
		"env": {
			"es6": true
		},
		"parserOptions": {
			"ecmaVersion": "latest",
			"sourceType": "module"
		},
		"plugins": [
			"ava"
		],
		"rules": {
			"ava/assertion-arguments": "error",
			"ava/...": "error"
        }
    }
}

Rules

The rules will only activate in test files.

πŸ’Ό Configurations enabled in.
⚠️ Configurations set to warn in.
🚫 Configurations disabled in.
βœ… Set in the recommended configuration.
πŸ”§ Automatically fixable by the --fix CLI option.
πŸ’‘ Manually fixable by editor suggestions.

Name Description πŸ’Ό ⚠️ 🚫 πŸ”§ πŸ’‘
assertion-arguments Enforce passing correct arguments to assertions. βœ… πŸ”§
hooks-order Enforce test hook ordering. βœ… πŸ”§
max-asserts Enforce a limit on the number of assertions in a test. βœ…
no-async-fn-without-await Ensure that async tests use await. βœ…
no-duplicate-modifiers Ensure tests do not have duplicate modifiers. βœ…
no-identical-title Ensure no tests have the same title. βœ…
no-ignored-test-files Ensure no tests are written in ignored files. βœ…
no-import-test-files Ensure no test files are imported anywhere. βœ…
no-incorrect-deep-equal Disallow using deepEqual with primitives. βœ… πŸ”§
no-inline-assertions Ensure assertions are not called from inline arrow functions. βœ… πŸ”§
no-nested-tests Ensure no tests are nested. βœ…
no-only-test Ensure no test.only() are present. βœ… πŸ”§ πŸ’‘
no-skip-assert Ensure no assertions are skipped. βœ…
no-skip-test Ensure no tests are skipped. βœ… πŸ”§ πŸ’‘
no-todo-implementation Ensure test.todo() is not given an implementation function. βœ…
no-todo-test Ensure no test.todo() is used. βœ…
no-unknown-modifiers Disallow the use of unknown test modifiers. βœ…
prefer-async-await Prefer using async/await instead of returning a Promise. βœ…
prefer-power-assert Enforce the use of the asserts that have no power-assert alternative. βœ…
prefer-t-regex Prefer using t.regex() to test regular expressions. βœ… πŸ”§
test-title Ensure tests have a title. βœ…
test-title-format Ensure test titles have a certain format. βœ…
use-t Ensure test functions use t as their parameter. βœ…
use-t-throws-async-well Ensure that t.throwsAsync() and t.notThrowsAsync() are awaited. βœ… πŸ”§
use-t-well Disallow the incorrect use of t. βœ… πŸ”§
use-test Ensure that AVA is imported with test as the variable name. βœ…
use-true-false Ensure that t.true()/t.false() are used instead of t.truthy()/t.falsy(). βœ…

Recommended config

This plugin exports a recommended config that enforces good practices.

Enable it in your package.json with the extends option:

{
	"name": "my-awesome-project",
	"eslintConfig": {
		"extends": "plugin:ava/recommended"
	}
}

See the ESLint docs for more information about extending config files.

Note: This config will also enable the correct parser options and environment.

Current Tags

  • 18.0.0                                ...           latest (2 months ago)
  • 7.0.0-rc.1                                ...           next (8 years ago)

65 Versions

  • 18.0.0                                ...           2 months ago
  • 17.0.1                                ...           6 months ago
  • 17.0.0                                ...           6 months ago
  • 16.0.1                                ...           8 months ago
  • 16.0.0                                ...           10 months ago
  • 15.1.0                                ...           a year ago
  • 15.0.1                                ...           3 years ago
  • 15.0.0                                ...           3 years ago
  • 14.0.0                                ...           4 years ago
  • 13.2.0                                ...           5 years ago
  • 13.1.0                                ...           5 years ago
  • 13.0.0                                ...           5 years ago
  • 12.0.0                                ...           6 years ago
  • 11.0.0                                ...           6 years ago
  • 10.5.0                                ...           6 years ago
  • 10.4.0                                ...           6 years ago
  • 10.3.1                                ...           6 years ago
  • 10.3.0                                ...           7 years ago
  • 10.2.0                                ...           7 years ago
  • 10.1.0                                ...           7 years ago
  • 10.0.1                                ...           7 years ago
  • 10.0.0                                ...           7 years ago
  • 9.0.0                                ...           7 years ago
  • 8.0.0                                ...           7 years ago
  • 7.1.0                                ...           7 years ago
  • 7.0.0                                ...           7 years ago
  • 7.0.0-rc.1                                ...           8 years ago
  • 6.0.0                                ...           8 years ago
  • 5.1.1                                ...           8 years ago
  • 5.1.0                                ...           8 years ago
  • 5.0.0                                ...           8 years ago
  • 4.5.1                                ...           9 years ago
  • 4.5.0                                ...           9 years ago
  • 4.4.0                                ...           9 years ago
  • 4.3.0                                ...           9 years ago
  • 4.2.2                                ...           9 years ago
  • 4.2.1                                ...           9 years ago
  • 4.2.0                                ...           10 years ago
  • 4.1.0                                ...           10 years ago
  • 4.0.1                                ...           10 years ago
  • 4.0.0                                ...           10 years ago
  • 3.1.1                                ...           10 years ago
  • 3.1.0                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.5.0                                ...           10 years ago
  • 2.4.0                                ...           11 years ago
  • 2.3.1                                ...           11 years ago
  • 2.3.0                                ...           11 years ago
  • 2.2.1                                ...           11 years ago
  • 2.2.0                                ...           11 years ago
  • 2.1.0                                ...           11 years ago
  • 2.0.1                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
  • 1.4.1                                ...           11 years ago
  • 1.4.0                                ...           11 years ago
  • 1.3.2                                ...           11 years ago
  • 1.3.1                                ...           11 years ago
  • 1.3.0                                ...           11 years ago
  • 1.2.1                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Downloads
Total 482
Today 2
This Week 39
This Month 211
Last Day 5
Last Week 31
Last Month 266
Dependencies (5)
Dev Dependencies (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE