-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
120 lines (117 loc) · 3.88 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
"browser": true,
"mocha": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"project": "tsconfig-eslint.json"
},
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"rules": {
/* Best practices */
"curly": "error",
"dot-location": ["warn", "property"],
"dot-notation": "error",
"eqeqeq": ["error", "smart"],
"no-eval": "error",
"no-extend-native": "error",
"no-fallthrough": "warn",
"no-floating-decimal": "warn",
"no-implied-eval": "error",
"no-iterator": "error",
"no-loop-func": "warn",
"no-multi-str": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-proto": "error",
"no-return-assign": "error",
"no-script-url": "error",
"no-self-compare": "warn",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-useless-concat": "warn",
"no-useless-return": "warn",
"no-void": "error",
"no-warning-comments": "warn",
"prefer-promise-reject-errors": "error",
"require-unicode-regexp": "error",
"no-undefined": "error",
/* Stylistic */
"array-bracket-newline": ["warn", { "multiline": true }],
"block-spacing": "warn",
"capitalized-comments": "warn",
"comma-dangle": "warn",
"comma-spacing": "warn",
"comma-style": "warn",
"computed-property-spacing": "warn",
"consistent-this": "error",
"eol-last": "warn",
"func-call-spacing": "warn",
"function-call-argument-newline": ["warn", "consistent"],
"function-paren-newline": ["error", "multiline"],
"implicit-arrow-linebreak": "warn",
"key-spacing": ["warn", { "mode": "minimum" }],
"keyword-spacing": "warn",
"linebreak-style": "warn",
"lines-around-comment": "warn",
"lines-between-class-members": "warn",
"max-len": ["warn", {"code": 100}],
"max-statements-per-line": "warn",
"multiline-comment-style": "warn",
"new-cap": "error",
"new-parens": "error",
"no-lonely-if": "error",
"no-multiple-empty-lines": "warn",
"no-nested-ternary": "error",
"no-trailing-spaces": "warn",
"no-whitespace-before-property": "warn",
"object-curly-newline": "warn",
"object-property-newline": "warn",
"semi-spacing": "warn",
"semi-style": "warn",
"space-before-blocks": "warn",
"space-before-function-paren": ["warn", {"anonymous": "never", "named": "never", "asyncArrow": "always"}],
"space-in-parens": "warn",
"space-infix-ops": "warn",
"space-unary-ops": ["warn", {"words": true, "nonwords": false}],
"spaced-comment": "warn",
"switch-colon-spacing": "warn",
"unicode-bom": "error",
/* ECMAScript 6 */
"arrow-parens": "error",
"arrow-spacing": "warn",
"no-confusing-arrow": "error",
"no-useless-computed-key": "error",
"no-useless-rename": "error",
"prefer-numeric-literals": "error",
"template-curly-spacing": "warn",
"yield-star-spacing": "warn",
/* Typescript-specific */
"@typescript-eslint/consistent-type-assertions": [ "error", { "assertionStyle": "angle-bracket" } ],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/brace-style": "warn",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/func-call-spacing": "warn",
"@typescript-eslint/indent": ["warn", "tab", { "MemberExpression": 2, "CallExpression": {"arguments": 2}, "SwitchCase": 1, "FunctionExpression": {"body": 1, "parameters": 2} }],
"@typescript-eslint/no-parameter-properties": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/restrict-plus-operands": "error"
}
}