This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.js
62 lines (62 loc) · 2.19 KB
/
jest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// https://github.com/kentcdodds/eslint-config-kentcdodds/blob/master/jest.js
module.exports = {
plugins: ['jest', 'jest-dom', 'testing-library'],
rules: {
// jest
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/valid-expect': 'error',
'jest/no-alias-methods': 'off',
'jest/no-jest-import': 'error',
'jest/no-large-snapshots': ['warn', { maxSize: 300 }],
'jest/no-test-prefixes': 'error',
'jest/prefer-to-contain': 'warn',
'jest/prefer-to-have-length': 'warn',
'jest/valid-describe': 'error',
'jest/valid-expect-in-promise': 'error',
'jest/consistent-test-it': 'off',
'jest/lowercase-name': 'off',
'jest/no-hooks': 'off',
'jest/no-jasmine-globals': 'off',
'jest/no-test-callback': 'off',
'jest/prefer-expect-assertions': 'off',
'jest/prefer-to-be-null': 'off',
'jest/prefer-to-be-undefined': 'off',
'jest/require-to-throw-message': 'off',
'jest/expect-expect': 'off',
'jest/no-test-return-statement': 'off',
'jest/prefer-inline-snapshots': 'off',
'jest/prefer-strict-equal': 'off',
'jest/prefer-spy-on': 'off',
'jest/prefer-todo': 'warn',
'jest/prefer-called-with': 'error',
'jest/no-truthy-falsy': 'off',
'jest/no-mocks-import': 'error',
'jest/no-commented-out-tests': 'warn',
'jest/no-duplicate-hooks': 'off',
'jest/no-expect-resolves': 'off',
'jest/no-export': 'error',
'jest/no-if': 'error',
'jest/no-standalone-expect': 'error',
'jest/no-try-expect': 'error',
'jest/require-top-level-describe': 'error',
'jest/prefer-hooks-on-top': 'error',
'jest/valid-title': 'warn',
// jest-dom
'jest-dom/prefer-checked': 'error',
'jest-dom/prefer-empty': 'error',
'jest-dom/prefer-enabled-disabled': 'error',
'jest-dom/prefer-focus': 'error',
'jest-dom/prefer-required': 'error',
'jest-dom/prefer-to-have-attribute': 'error',
'jest-dom/prefer-to-have-text-content': 'error',
// testing-library
'testing-library/await-async-query': 'error',
'testing-library/no-await-sync-query': 'error',
'testing-library/no-debug': 'warn',
},
env: {
'jest/globals': true,
},
};