JSPM

  • Created
  • Published
  • Downloads 493658
  • Score
    100M100P100Q176551F
  • 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

ESLint rules for AVA

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": 6,
            "sourceType": "module"
        },
        "plugins": [
            "ava"
        ],
        "rules": {
            "ava/max-asserts": [2, 5],
            "ava/no-cb-test": 0,
            "ava/no-identical-title": 2,
            "ava/no-invalid-end": 2,
            "ava/no-only-test": 2,
            "ava/no-skip-assert": 2,
            "ava/no-skip-test": 2,
            "ava/no-statement-after-end": 2,
            "ava/no-todo-test": 1,
            "ava/no-unknown-modifiers": 2,
            "ava/prefer-power-assert": 0,
            "ava/test-ended": 2,
            "ava/test-title": [2, "always"],
            "ava/use-t": 2,
            "ava/use-test": 2
        }
    }
}

Rules

The rules will only activate in test files.

This plugin exports a recommended configuration that enforces good practices.

To enable this configuration use the extends property in your package.json.

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

See ESLint documentation for more information about extending configuration files.

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

Credit

License

MIT © Sindre Sorhus