forked from amfa-team/eslint-config-sbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypescript.js
85 lines (85 loc) · 4.15 KB
/
typescript.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
module.exports = {
parser: "@typescript-eslint/parser",
extends: ["prettier", "prettier/@typescript-eslint"],
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/ban-types": "error",
// "@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
"@typescript-eslint/consistent-type-imports": ["error"],
"@typescript-eslint/naming-convention": ["off"],
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-implicit-any-catch": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-enum-initializers": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/unbound-method": "error",
"@typescript-eslint/unified-signatures": "error",
},
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"default-param-last": "off",
"@typescript-eslint/default-param-last": ["error"],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": ["error"],
// "no-duplicate-imports": "off",
// "@typescript-eslint/no-duplicate-imports": ["error"],
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": ["error"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
// note you must disable the base rule as it can report incorrect errors
"no-implied-eval": "off",
"@typescript-eslint/no-implied-eval": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-loop-func": "off",
"@typescript-eslint/no-loop-func": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
// note you must disable the base rule as it can report incorrect errors
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
"no-undef": "off",
},
},
],
};