15.0.1 β€’ Published 1 year ago

eslint-plugin-ava v15.0.1

Weekly downloads
69,636
License
MIT
Repository
github
Last release
1 year ago

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-argumentsEnforce passing correct arguments to assertions.βœ…πŸ”§
hooks-orderEnforce test hook ordering.βœ…πŸ”§
max-assertsEnforce a limit on the number of assertions in a test.βœ…
no-async-fn-without-awaitEnsure that async tests use await.βœ…
no-duplicate-modifiersEnsure tests do not have duplicate modifiers.βœ…
no-identical-titleEnsure no tests have the same title.βœ…
no-ignored-test-filesEnsure no tests are written in ignored files.βœ…
no-import-test-filesEnsure no test files are imported anywhere.βœ…
no-incorrect-deep-equalDisallow using deepEqual with primitives.βœ…πŸ”§
no-inline-assertionsEnsure assertions are not called from inline arrow functions.βœ…πŸ”§
no-nested-testsEnsure no tests are nested.βœ…
no-only-testEnsure no test.only() are present.βœ…πŸ”§πŸ’‘
no-skip-assertEnsure no assertions are skipped.βœ…
no-skip-testEnsure no tests are skipped.βœ…πŸ”§πŸ’‘
no-todo-implementationEnsure test.todo() is not given an implementation function.βœ…
no-todo-testEnsure no test.todo() is used.βœ…
no-unknown-modifiersDisallow the use of unknown test modifiers.βœ…
prefer-async-awaitPrefer using async/await instead of returning a Promise.βœ…
prefer-power-assertEnforce the use of the asserts that have no power-assert alternative.βœ…
prefer-t-regexPrefer using t.regex() to test regular expressions.βœ…πŸ”§
test-titleEnsure tests have a title.βœ…
test-title-formatEnsure test titles have a certain format.βœ…
use-tEnsure test functions use t as their parameter.βœ…
use-t-throws-async-wellEnsure that t.throwsAsync() and t.notThrowsAsync() are awaited.βœ…πŸ”§
use-t-wellDisallow the incorrect use of t.βœ…πŸ”§
use-testEnsure that AVA is imported with test as the variable name.βœ…
use-true-falseEnsure 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.

eslint-config-quartz@conten2/eslint-config@sno2wman/eslint-configeslint-config-happyeslint-config-neaf@pascaliske/linterbreki-styleguideseslint-config-quarkmichaelkohler-eslint-config-test@michaelkohler/eslint-config-test@infinitebrahmanuniverse/nolb-eslint-plugin-a@everything-registry/sub-chunk-1610standard-esnextsx-config@comandeer/eslint-config@coorpacademy/eslint-plugin-coorpacademy@panmenghan/startersparetest@anonrig/eslint-config@benzinga/eslint-config-benzingaxoxo-browser-focused-fork@fisker/eslint-config-ava@electerious/eslint-config@freaktechnik/eslint-config-test@ls-age/eslint-config@lesnoypudge/eslint-config@netlify/eslint-config-node@enormora/eslint-config-ava@metahub/eslint-config@mishguru/eslint-config@mishguru/eslint-typescript-config@justindfuller/verse-of-the-day@knapsack/eslint-config@knapsack/eslint-config-starter@omniblack/eslint-config@qiuqfang/get-port@radum/temp@radum/eslint-config@r2d2bzh/js-rules@onia/cute@novemberborn/as-i-preach@octetstream/eslint-config@papb/lintermobbosssindresorhus.jsgulp-shared-tasksgulpy-boiler-task-eslintlint-config-mlinterjslinteslintalo@tf2-pickup/eslint-configbegin-lintingbegin-projectbroomyefarm-configseslint-config-lsageeslint-config-prettyeslint-config-labs42eslint-config-lidskasilaeslint-config-henribeckeslint-config-oniyieslint-config-rehyeslint-config-tf2pickupeslint-config-sno2wmaneslint-config-unityeslint-config-ultimateeslint-config-touch4iteslint-config-tdpeslint-config-simenb-avaeslint-config-vyorkineslint-config-astureslint-config-coldeslint-config-concise-avaeslint-config-efarmeslint-config-bem-sdkeslint-config-canonicaleslint-config-current-thingeslint-config-archereducationeslint-config-aretecodeeslint-config-dustinspeckereslint-config-mainframeeslint-config-gulpy-boilereslint-config-lotteryeslint-config-fuzzyeslint-config-gowentoeslint-plugin-minorisgerms@sergeypistest/eslint-config@styled-x/config@styledx/config@stefanoa1/eslint-plugin-sab@spence-s/flat-xo@system76/eslint-config@system76/eslint-config-standard@sno2wman/eslint
15.0.1

1 year ago

15.0.0

1 year ago

14.0.0

3 years ago

13.2.0

4 years ago

13.1.0

4 years ago

13.0.0

4 years ago

12.0.0

5 years ago

11.0.0

5 years ago

10.5.0

5 years ago

10.4.0

5 years ago

10.3.1

5 years ago

10.3.0

5 years ago

10.2.0

6 years ago

10.1.0

6 years ago

10.0.1

6 years ago

10.0.0

6 years ago

9.0.0

6 years ago

8.0.0

6 years ago

7.1.0

6 years ago

7.0.0

6 years ago

7.0.0-rc.1

6 years ago

6.0.0

7 years ago

5.1.1

7 years ago

5.1.0

7 years ago

5.0.0

7 years ago

4.5.1

8 years ago

4.5.0

8 years ago

4.4.0

8 years ago

4.3.0

8 years ago

4.2.2

8 years ago

4.2.1

8 years ago

4.2.0

9 years ago

4.1.0

9 years ago

4.0.1

9 years ago

4.0.0

9 years ago

3.1.1

9 years ago

3.1.0

9 years ago

3.0.0

9 years ago

2.5.0

9 years ago

2.4.0

9 years ago

2.3.1

9 years ago

2.3.0

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago