-
Notifications
You must be signed in to change notification settings - Fork 12
/
jest.mjs
53 lines (51 loc) · 1.38 KB
/
jest.mjs
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
import jestPlugin from "eslint-plugin-jest";
import base from "./base.mjs";
export default [
{
settings: {
jest: {
version: 30,
},
},
},
...base,
jestPlugin.configs["flat/recommended"],
jestPlugin.configs["flat/style"],
{
files: ["**/__tests__/*.ts"],
plugins: {
jest: jestPlugin,
},
rules: {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"jest/consistent-test-it": "error",
"jest/no-conditional-in-test": "error",
"jest/no-duplicate-hooks": "error",
"jest/no-test-return-statement": "error",
"jest/prefer-comparison-matcher": "error",
"jest/prefer-each": "error",
"jest/prefer-equality-matcher": "error",
"jest/prefer-expect-assertions": [
"warn",
{
onlyFunctionsWithAsyncKeyword: true,
onlyFunctionsWithExpectInCallback: true,
onlyFunctionsWithExpectInLoop: true,
},
],
"jest/prefer-expect-resolves": "error",
"jest/prefer-lowercase-title": [
"error",
{
ignoreTopLevelDescribe: true,
},
],
"jest/prefer-mock-promise-shorthand": "error",
"jest/prefer-spy-on": "error",
"jest/prefer-todo": "error",
"jest/require-top-level-describe": "error",
},
},
];