- Notifications
You must be signed in to change notification settings - Fork50
avajs/eslint-plugin-ava
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ESLint rules forAVA
Translations:Français
This plugin is bundled inXO. No need to do anything if you're using it.
Propose or contribute a new rule ➡
npm install --save-dev eslint eslint-plugin-ava
Configure it inpackage.json
.
{"name":"my-awesome-project","eslintConfig": {"env": {"es6":true},"parserOptions": {"ecmaVersion":"latest","sourceType":"module"},"plugins": ["ava"],"rules": {"ava/assertion-arguments":"error","ava/...":"error" } }}
The rules will only activate in test files.
💼Configurations enabled in.
🚫Configurations disabled in.
✅ Set in therecommended
configuration.
🔧 Automatically fixable by the--fix
CLI option.
💡 Manually fixable byeditor 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 useawait . | ✅ | ||||
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 usingdeepEqual 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 notest.only() are present. | ✅ | 🔧 | 💡 | ||
no-skip-assert | Ensure no assertions are skipped. | ✅ | ||||
no-skip-test | Ensure no tests are skipped. | ✅ | 🔧 | 💡 | ||
no-todo-implementation | Ensuretest.todo() is not given an implementation function. | ✅ | ||||
no-todo-test | Ensure notest.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 nopower-assert alternative. | ✅ | ||||
prefer-t-regex | Prefer usingt.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 uset as their parameter. | ✅ | ||||
use-t-throws-async-well | Ensure thatt.throwsAsync() andt.notThrowsAsync() are awaited. | ✅ | 🔧 | |||
use-t-well | Disallow the incorrect use oft . | ✅ | 🔧 | |||
use-test | Ensure that AVA is imported withtest as the variable name. | ✅ | ||||
use-true-false | Ensure thatt.true() /t.false() are used instead oft.truthy() /t.falsy() . | ✅ |
This plugin exports arecommended
config that enforces good practices.
Enable it in yourpackage.json
with theextends
option:
{"name":"my-awesome-project","eslintConfig": {"extends":"plugin:ava/recommended"}}
See theESLint docs for more information about extending config files.
Note: This config will also enable the correctparser options andenvironment.
About
ESLint rules for AVA
Topics
Resources
License
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.