-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
40 lines (39 loc) · 940 Bytes
/
eslint.config.mjs
File metadata and controls
40 lines (39 loc) · 940 Bytes
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
import globals from "globals";
import pluginJs from "@eslint/js";
import jest from "eslint-plugin-jest";
export default [
pluginJs.configs.recommended,
{
languageOptions: {
globals: {
...Object.keys(globals.node).reduce((acc, key) => {
acc[key] = "readonly";
return acc;
}, {}),
},
},
rules: {
complexity: ["error", 5],
"max-lines-per-function": ["error", { max: 25 }],
},
},
{
files: ["**/*.test.js", "**/*.spec.js"],
plugins: { jest },
languageOptions: {
globals: {
describe: "readonly",
it: "readonly",
expect: "readonly",
},
},
rules: {
...jest.configs.recommended.rules,
"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",
},
},
];