-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.json
76 lines (72 loc) · 2.41 KB
/
.eslintrc.json
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
"root": true,
"env": {
"es2020": true,
"jest": true
},
"ignorePatterns": [".eslintrc.js"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "es2020",
"sourceType": "module",
"project": "./tsconfig.test.json"
},
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
// base eslint rules
"curly": "error",
"indent": "off",
"semi": ["error", "always"],
"no-cond-assign": ["error", "always"],
"init-declarations": "off",
"no-console": "error", // you should use the Logger to avoid this
"eqeqeq": "error",
"no-promise-executor-return": "error",
"no-template-curly-in-string": "error",
"no-unreachable-loop": "error",
"no-unsafe-optional-chaining": "error",
"require-atomic-updates": "error",
"array-callback-return": "error",
"no-prototype-builtins": "off",
"require-await": "error",
"no-var": "error",
// eslint & typescript-eslint rule pairs
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": "error",
"no-use-before-define": "error",
"@typescript-eslint/no-use-before-define": "error",
// typescript-eslint rules
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "error", // turning this off removes type safety. use an if(){} to check for the null
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/no-misused-promises": ["error", { "checksConditionals": true, "checksVoidReturn": true }],
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false
}
],
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"import/no-unresolved": "off",
"import/first": "error"
}
}