Skip to content

Instantly share code, notes, and snippets.

@xeptore
Last active May 12, 2019 11:35
Show Gist options
  • Save xeptore/620a07827f62787311fa03df4ebe3c97 to your computer and use it in GitHub Desktop.
Save xeptore/620a07827f62787311fa03df4ebe3c97 to your computer and use it in GitHub Desktop.
eslint configurations for Node apps with Jest
env:
es6: true
node: true
commonjs: true
jest: true
jest/globals: true
plugins:
- jest
extends:
- 'eslint:recommended'
- 'plugin:import/errors'
- 'plugin:import/warnings'
- 'plugin:jest/recommended'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaVersion: 6
sourceType: module
rules:
keyword-spacing: 2
no-trailing-spaces: 2
no-multiple-empty-lines: 2
eol-last: 2
no-tabs: 2
no-nested-ternary: 2
no-extra-semi: 2
constructor-super: 2
array-bracket-spacing:
- 2
- never
no-var: 2
max-len:
- 1
-
code: 85
tabWidth: 2
no-func-assign: 2
consistent-return: 2
curly:
- 2
- all
default-case: 2
eqeqeq:
- 2
- always
no-multi-spaces: 2
array-bracket-newline:
- 2
- consistent
comma-dangle:
- 2
- always-multiline
comma-spacing: 2
no-console: 0
indent:
- 2
- 2
linebreak-style:
- 2
- unix
quotes:
- 2
- single
semi:
- 2
- always
import/newline-after-import:
- 2
-
count: 2
jest/no-disabled-tests: warn
jest/no-focused-tests: error
jest/no-identical-title: error
jest/prefer-to-have-length: warn
jest/valid-expect: error
@xeptore
Copy link
Author

xeptore commented Feb 10, 2019

also install dollowing packages:
npm:

npm install --save-dev eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-jest

yarn:

yarn add --dev eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-jest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment