-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
91 lines (91 loc) · 3.61 KB
/
.eslintrc.js
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
module.exports = {
env: {
browser: true,
es2021: true,
},
overrides: [
{
files: "./src/**/*.ts",
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"eslint-config-prettier",
"plugin:@typescript-eslint/strict",
"plugin:react-hooks/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint"],
rules: {
/* Logic Errors */
// Enforces use of Promise.all
"no-await-in-loop": "error",
"no-constant-binary-expression": "error",
"no-constructor-return": "error",
"no-duplicate-imports": "warn",
"no-self-compare": "warn",
"no-template-curly-in-string": "warn",
"no-unreachable-loop": "warn",
"no-unused-private-class-members": "error",
"require-atomic-updates": "warn",
/* Suggestions */
camelcase: "warn",
"dot-notation": "warn",
eqeqeq: "warn",
"guard-for-in": "warn",
"new-cap": "warn",
"no-array-constructor": "warn",
"no-caller": "error",
"no-else-return": "warn",
"no-eval": "error",
"no-extra-bind": "warn",
"no-implicit-coercion": "warn",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-lonely-if": "warn",
"no-new": "error",
"no-new-object": "error",
"no-new-wrappers": "error",
"no-return-await": "warn",
"no-script-url": "error",
"no-throw-literal": "error",
"no-unneeded-ternary": "warn",
"no-unused-expressions": "warn",
"no-useless-call": "warn",
"no-useless-rename": "warn",
"no-useless-return": "warn",
"no-var": "error",
"prefer-const": "warn",
"prefer-destructuring": "warn",
"prefer-object-spread": "warn",
"prefer-regex-literals": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"require-await": "error",
/* TypeScript */
// These are very useful in the context of writing code for the browser.
"@typescript-eslint/no-non-null-assertion": "off",
// Allow unused vars starting with '_'
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],
"@typescript-eslint/member-ordering": "warn",
"@typescript-eslint/no-confusing-void-expression": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/triple-slash-reference": "off",
},
},
],
};