@beyondessential/eslint-config-jest

1.0.1 • Public • Published

@beyondessential/eslint-config-jest

Jest style guide as as shareable ESLint configuration

This package defines Beyond Essential System's style guide for Jest.

Installation

Install the package and its required peer dependencies:

yarn add -D @beyondessential/eslint-config-jest eslint prettier

Usage

You need to extend this package in your ESLint configuration:

{
  "extends": "@beyondessential/jest"
}

Publishing

  1. Checkout the latest code: git fetch && git checkout master
  2. Commit your changes in a new branch
  3. ⚠️ Don't forget to also update the package version: npm version # < patch || minor || major >
  4. Create a pull request against master

After your PR is approved and merged:

git fetch && git checkout master && git pull
npm login
npm publish --access public

Style guide

We use the recommended rules from eslint-plugin-jest, with a few changes.

Changes

Rule Airbnb BES Comment
jest/expect-expect error ['warn', { assertFunctionNames: ['expect', 'assert*'] }] Our assert* functions conventionally use expect under the hood
jest/valid-describe error off The implementation of this rule does not allow imported functions as describe callbacks
jest/valid-title error off Title may be a variable

Package Sidebar

Install

npm i @beyondessential/eslint-config-jest

Weekly Downloads

62

Version

1.0.1

License

MIT

Unpacked Size

3.91 kB

Total Files

3

Last publish

Collaborators

  • igor_bes
  • bas_go
  • edmofro
  • mcccclean
  • kael89
  • alastair-l
  • rohan-bes