-
Notifications
You must be signed in to change notification settings - Fork 517
/
.eslintrc.json
65 lines (65 loc) · 2.58 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": "tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [ // Naming is enforced with some exceptions below
"warn",
{ // Names should be either camelCase or PascalCase, both are extensively used throughout this project
"selector": "default",
"format": [
"camelCase",
"PascalCase"
]
},
{ // const variables can also have UPPER_CASE
"selector": "variable",
"modifiers": [
"const"
],
"format": [
"camelCase",
"PascalCase",
"UPPER_CASE"
]
},
{ // private class properties can also have leading _underscores
"selector": "classProperty",
"modifiers": [
"private"
],
"format": [
"camelCase",
"PascalCase"
],
"leadingUnderscore": "allow"
}
],
"@typescript-eslint/no-floating-promises": "warn", // Floating promises are bad, should do `void thePromise()`
"@typescript-eslint/no-inferrable-types": "off", // This gets upset about e.g. `const foo: string = 'bar'` because it's obvious that it's a string; it doesn't matter enough to enforce
"@typescript-eslint/no-unused-vars": [ // Unused variables aren't allowed, with an exception (below)
"warn",
{ // As a function parameter, unused parameters are allowed
"args": "none"
}
],
"@typescript-eslint/semi": "warn", // Elevate this to warning, we like semicolons
"curly": "warn", // May have been a mistake to include a `{curly}` inside a template string, you might mean `${curly}`
"eqeqeq": "warn", // Should use `===`, not `==`, nearly 100% of the time
"no-extra-boolean-cast": "off", // We !!flatten a lot of things into booleans this way
"no-throw-literal": "warn", // Elevate this from suggestion to warning
"semi": "off" // Covered by @typescript-eslint/semi
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}