-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.js
53 lines (52 loc) · 1.32 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
// @ts-check
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */
const eslintConfig = {
settings: {
jest: {
version: 26,
},
},
overrides: [
{
files: [
'**/*.test.ts',
'**/*.test.tsx',
'**/*.test.js',
'**/*.test.jsx',
'**/*.spec.ts',
'**/*.spec.tsx',
'**/*.spec.js',
'**/*.spec.jsx',
],
env: {
jest: true, // now **/*.test.js files' env has both es6 *and* jest
},
extends: ['plugin:jest/all'],
rules: {
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
'jest/prefer-expect-assertions': ['error', { onlyFunctionsWithAsyncKeyword: true }],
'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
'jest/no-hooks': 'off',
'jest/prefer-snapshot-hint': 'off',
'jest/require-hook': [
'error',
{
// allow the use of vitest functions
allowedFunctionCalls: [
'beforeAll',
'afterAll',
'beforeEach',
'afterEach',
'describe',
'it',
'test',
'vi.mock',
],
},
],
},
},
],
};
module.exports = eslintConfig;