-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
58 lines (57 loc) · 1.54 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
47
48
49
50
51
52
53
54
55
56
57
58
import globals from "globals";
import pluginJs from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ["**/*.ts"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
ecmaVersion: "latest",
sourceType: "module",
tsconfigRootDir: ".",
},
},
plugins: {
"@typescript-eslint": tsPlugin,
},
rules: {
...tsPlugin.configs.recommended.rules,
...tsPlugin.configs["recommended-requiring-type-checking"].rules,
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false, // Allows Promises in places like `afterAll`
},
],
"@typescript-eslint/restrict-template-expressions": "error",
},
},
{
files: ["**/*.{js,mjs,cjs}"],
...pluginJs.configs.recommended,
},
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
},
},
];