JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 441774
  • Score
    100M100P100Q186841F
  • License MIT

This plugin makes 'no-unused-expressions' rule friendly towards chai expect statements.

Package Exports

  • eslint-plugin-chai-friendly

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-chai-friendly) 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-chai-friendly

This plugin overrides no-unused-expressions to make it friendly towards chai expect statements.

// this
expect(foo).to.be.true;

// instead of this
expect(foo).to.be.true; // eslint-disable-line no-unused-expressions

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-chai-friendly:

$ npm install eslint-plugin-chai-friendly --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-chai-friendly globally.

Usage

Add chai-friendly to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "chai-friendly"
    ]
}

Then disable original no-unused-expressions rule and configure chai-friendly replacement under the rules section.

{
    "rules": {
        "no-unused-expressions": 0,
        "chai-friendly/no-unused-expressions": 2
    }
}

Supported Rules

  • chai-friendly/no-unused-expressions