-
Notifications
You must be signed in to change notification settings - Fork 37
/
.eslintrc.json
80 lines (80 loc) · 2.53 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
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "check-file"],
"parserOptions": {
"ecmaVersion": 6
},
"env": {
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"check-file/folder-naming-convention": [
"error",
{
"src/**/": "KEBAB_CASE",
"test/lib/**/": "KEBAB_CASE",
"test/unit/**/": "KEBAB_CASE"
}
],
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "default", "format": ["camelCase", "UPPER_CASE"] },
{ "selector": "typeLike", "format": ["PascalCase"] },
{
"selector": "typeParameter",
"format": ["PascalCase"]
},
{
"selector": "interface",
"format": ["PascalCase"],
"custom": { "regex": "^I[A-Z]", "match": false }
}
],
// our typing is a mess
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"String": {
"message": "Use string instead unless you are referring to the constructor",
"fixWith": "string"
},
"Number": {
"message": "Use number instead unless you are referring to the constructor",
"fixWith": "number"
},
"Boolean": {
"message": "Use boolean instead unless you are referring to the constructor",
"fixWith": "boolean"
}
},
"extendDefaults": false
}
],
"no-prototype-builtins": "off",
// Conventions have won, sorry linter!
"@typescript-eslint/no-empty-function": "off",
// non-null assertions compromise the type safety somewhat, but many
// our types are still imprecisely defined and we don"t use noImplicitAny
// anyway, so for the time being assertions are allowed
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/consistent-type-imports": "error",
// cares about function ordering in a file in a way we don"t care about
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-buffer-constructor": "error",
"no-import-assign": "error"
}
}