-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy patheslint.config.mjs
More file actions
43 lines (38 loc) · 1.23 KB
/
eslint.config.mjs
File metadata and controls
43 lines (38 loc) · 1.23 KB
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
import { fileURLToPath, URL } from "node:url";
import { includeIgnoreFile } from "@eslint/compat";
import { defineConfig } from "eslint/config";
// Configs
import fdawgs from "@fdawgs/eslint-config";
// Plugins
import jest from "eslint-plugin-jest";
const gitignorePath = fileURLToPath(new URL(".gitignore", import.meta.url));
const config = defineConfig([
// Include ignore file to prevent linting of files in .gitignore
includeIgnoreFile(gitignorePath),
{
files: ["**/*.js"],
extends: [fdawgs],
},
{
files: ["**/*.test.js"],
...jest.configs["flat/recommended"],
...jest.configs["flat/style"],
rules: {
...jest.configs["flat/recommended"].rules,
...jest.configs["flat/style"].rules,
"jest/no-duplicate-hooks": "error",
"jest/no-test-return-statement": "error",
"jest/prefer-comparison-matcher": "error",
"jest/prefer-each": "warn",
"jest/prefer-equality-matcher": "error",
"jest/prefer-expect-resolves": "error",
"jest/prefer-hooks-in-order": "error",
"jest/prefer-hooks-on-top": "error",
"jest/prefer-importing-jest-globals": "error",
"jest/prefer-mock-promise-shorthand": "error",
"jest/prefer-spy-on": "error",
"jest/require-top-level-describe": "error",
},
},
]);
export default config;