-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend.eslintrc.json
89 lines (84 loc) · 2.63 KB
/
backend.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
77
78
79
80
81
82
83
84
85
86
87
88
89
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
// Remove this:
// "plugin:@typescript-eslint/recommended",
// Add these:
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
// Add this:
"project": true
},
"plugins": [
"@typescript-eslint",
// Add this:
"import"
],
"rules": {
// Add all of these:
// Uncomment this if you have verbatimModuleSyntax enabled and importing
// .ts files with a .js extension gives lint errors.
// "import/no-unresolved": "off",
// Uncomment these if you really need to.
// "@typescript-eslint/ban-ts-comment": "off",
// "@typescript-eslint/no-explicit-any": "off",
// "@typescript-eslint/no-non-null-assertion": "off",
// Avoid bugs.
"@typescript-eslint/no-shadow": ["error", { "ignoreTypeValueShadow": true }],
"@typescript-eslint/no-unsafe-unary-minus": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
"array-callback-return": "error",
"eqeqeq": "error",
"no-await-in-loop": "error",
"no-constant-binary-expression": "error",
"no-constructor-return": "error",
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-promise-executor-return": "error",
"no-self-compare": "error",
"no-template-curly-in-string": "error",
// Stylistic.
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"object-shorthand": ["warn", "properties"],
"sort-imports": ["warn", { "ignoreDeclarationSort": true }],
"import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
"import/order": [
"warn",
{
"alphabetize": { "order": "asc" },
"groups": ["builtin", "external", "parent", "sibling", "index", "object", "type"],
"newlines-between": "always"
}
],
// Disabled because of too many false positives.
"@typescript-eslint/no-unnecessary-condition": "off"
}
}