-
-
Notifications
You must be signed in to change notification settings - Fork 220
/
jest.js
37 lines (35 loc) · 1.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
/**
* Custom config base for projects using jest.
* @see https://github.com/belgattitude/nextjs-monorepo-example/tree/main/packages/eslint-config-bases
*/
const jestPatterns = {
files: ['**/?(*.)+(test).{js,jsx,ts,tsx}'],
};
module.exports = {
env: {
es6: true,
node: true,
},
overrides: [
{
// Perf: To ensure best performance enable eslint-plugin-jest for test files only.
files: jestPatterns.files,
// @see https://github.com/jest-community/eslint-plugin-jest
extends: ['plugin:jest/recommended'],
rules: {
'jest/prefer-hooks-in-order': 'error',
'jest/prefer-hooks-on-top': 'error',
'jest/no-duplicate-hooks': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-strict-equal': 'error',
'jest/prefer-to-have-length': 'error',
'jest/consistent-test-it': ['error', { fn: 'it' }],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
],
};