JSPM

  • Created
  • Published
  • Downloads 493658
  • Score
    100M100P100Q176718F
  • License MIT

ESLint rules for AVA

Package Exports

  • eslint-plugin-ava

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-ava) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-plugin-ava Build Status Coverage Status

ESLint rules for AVA

Translations: Français

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": 7,
            "sourceType": "module"
        },
        "plugins": [
            "ava"
        ],
        "rules": {
            "ava/assertion-arguments": "error",
            "ava/assertion-message": ["off", "always"],
            "ava/max-asserts": ["off", 5],
            "ava/no-cb-test": "off",
            "ava/no-identical-title": "error",
            "ava/no-ignored-test-files": "error",
            "ava/no-invalid-end": "error",
            "ava/no-only-test": "error",
            "ava/no-skip-assert": "error",
            "ava/no-skip-test": "error",
            "ava/no-statement-after-end": "error",
            "ava/no-todo-test": "warn",
            "ava/no-unknown-modifiers": "error",
            "ava/prefer-power-assert": "off",
            "ava/test-ended": "error",
            "ava/test-title": ["error", "if-multiple"],
            "ava/use-t-well": "error",
            "ava/use-t": "error",
            "ava/use-test": "error",
            "ava/use-true-false": "error"
        }
    }
}

Rules

The rules will only activate in test files.

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": {
        "plugins": [
            "ava"
        ],
        "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.

Credit

And our awesome contributors

License

MIT © Sindre Sorhus