-
-
Notifications
You must be signed in to change notification settings - Fork 499
/
eslint.config.mjs
46 lines (44 loc) · 1.07 KB
/
eslint.config.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
// @ts-check
import eslint from "@eslint/js";
import jestPlugin from "eslint-plugin-jest";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import globals from "globals";
export default tseslint.config(
{
ignores: ["**/coverage/**", "**/lib/**", "**/node_modules/**", ".*", "**/*.json", "**/*.md"],
},
eslint.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
// disable type-aware linting on JS files
files: ["**/*.js"],
...tseslint.configs.disableTypeChecked
},
{
// enable jest rules on test files
files: ["**/*.test.*"],
...jestPlugin.configs["flat/recommended"],
languageOptions: {
globals: {
...globals.node,
...globals.jest,
...globals.browser,
}
}
},
{
// allow module.exports and require for config files
files: ["*.*"],
rules: {
"@typescript-eslint/no-require-imports": 0,
},
languageOptions: {
sourceType: "commonjs",
globals: {
...globals.node
},
}
}
);