1.0.1 • Published 4 years ago

@beyondessential/eslint-config-jest v1.0.1

Weekly downloads
68
License
MIT
Repository
github
Last release
4 years ago

@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

RuleAirbnbBESComment
jest/expect-expecterror['warn', { assertFunctionNames: 'expect', 'assert*' }]Our assert* functions conventionally use expect under the hood
jest/valid-describeerroroffThe implementation of this rule does not allow imported functions as describe callbacks
jest/valid-titleerroroffTitle may be a variable