14.0.0 β€’ Published 1 year ago

eslint-plugin-ava v14.0.0

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.

@knapsack/eslint-config-startereslint-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-1610@system76/eslint-config@system76/eslint-config-standard@coorpacademy/eslint-plugin-coorpacademybegin-lintingbegin-project@integreat/ts-dev-setup@anonrig/eslint-config@ls-age/eslint-config@metahub/eslint-config@mishguru/eslint-config@mishguru/eslint-typescript-config@netlify/eslint-config-node@justindfuller/verse-of-the-daybroomygermseslint-config-astureslint-config-aretecodeeslint-config-archereducationeslint-config-gulpy-boilereslint-config-simenb-avaeslint-config-tdpeslint-config-ultimateeslint-config-unityeslint-config-rehyeslint-config-iamnapoeslint-config-labs42eslint-config-henribeckeslint-config-gowentoeslint-config-lidskasilaeslint-plugin-minorisefarm-configseslint-config-fuzzyeslint-config-coldeslint-config-concise-avaeslint-config-bem-sdkeslint-config-efarmeslint-config-dustinspeckereslint-config-canonicaleslint-config-mainframeeslint-config-lsageeslint-config-lotteryeslint-config-current-thingeslint-config-vyorkineslint-config-oniyieslint-config-sno2wmaneslint-config-prettyeslint-config-tf2pickupeslint-config-touch4itgulp-shared-tasksgulpy-boiler-task-eslintsx-configsparetestsindresorhus.jsstandard-esnextxo-browser-focused-forkxo@benzinga/eslint-config-benzinga@fisker/eslint-config-ava@styled-x/config@styledx/config@freaktechnik/eslint-config-test@electerious/eslint-config@tf2-pickup/eslint-config@comandeer/eslint-config@enormora/eslint-config-ava@qiuqfang/get-portmobboss@onia/cute@octetstream/eslint-config@novemberborn/as-i-preach@r2d2bzh/js-rules@radum/eslint-config@radum/temp@knapsack/eslint-config@sergeypistest/eslint-config@omniblack/eslint-config@papb/linter@panmenghan/starterlint-config-mlinteslinterjslintalo@sno2wman/eslint@stefanoa1/eslint-plugin-sab
14.0.0

1 year ago

13.2.0

2 years ago

13.1.0

3 years ago

13.0.0

3 years ago

12.0.0

3 years ago

11.0.0

4 years ago

10.5.0

4 years ago

10.4.0

4 years ago

10.3.1

4 years ago

10.3.0

4 years ago

10.2.0

4 years ago

10.1.0

4 years ago

10.0.1

4 years ago

10.0.0

4 years ago

9.0.0

5 years ago

8.0.0

5 years ago

7.1.0

5 years ago

7.0.0

5 years ago

7.0.0-rc.1

5 years ago

6.0.0

5 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.0

6 years ago

4.5.1

6 years ago

4.5.0

6 years ago

4.4.0

6 years ago

4.3.0

6 years ago

4.2.2

7 years ago

4.2.1

7 years ago

4.2.0

7 years ago

4.1.0

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.1

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.5.0

8 years ago

2.4.0

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago