-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.json
127 lines (127 loc) · 4.79 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
121
122
123
124
125
126
127
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:ava/recommended",
"plugin:unicorn/recommended"
],
"env": {
"browser": false
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaVersion": "latest",
"sourceType": "module",
"project": true
},
"plugins": ["@typescript-eslint", "simple-import-sort", "eslint-plugin-ava", "unicorn"],
"root": true,
"rules": {
"eqeqeq": "error",
"no-constant-condition": "off",
"no-inner-declarations": "off",
"no-undef": "off",
"no-unused-vars": "off",
"no-restricted-globals": ["error", "console", "process", "Date"],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@typescript-eslint/no-import-type-side-effects": "error",
// In theory good, but less good when declaring a new interface and
// stopping to think about its contents.
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": [
"classProperty",
"typeProperty",
"parameterProperty",
"classMethod",
"typeMethod",
"accessor"
],
"modifiers": ["private"],
"leadingUnderscore": "require",
"format": ["camelCase"],
"filter": {
"regex": "^(test_| )",
"match": false
}
},
{
"selector": [
"classProperty",
"typeProperty",
"parameterProperty",
"classMethod",
"typeMethod",
"accessor"
],
"modifiers": ["protected"],
"leadingUnderscore": "allow",
"format": ["camelCase"],
"filter": {
"regex": "^(test_| )",
"match": false
}
},
{
"selector": [
"classProperty",
"typeProperty",
"parameterProperty",
"classMethod",
"typeMethod",
"accessor"
],
"modifiers": ["public"],
"leadingUnderscore": "forbid",
"format": ["camelCase"],
"filter": {
"regex": "^(test_| )",
"match": false
}
}
],
"@typescript-eslint/no-unnecessary-condition": ["error", {
"allowConstantLoopConditions": true
}],
"unicorn/catch-error-name": "off",
"unicorn/filename-case": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/prefer-top-level-await": "off", // Reenable once Node 12 is dropped.
"unicorn/prevent-abbreviations": "off",
"unicorn/switch-case-braces": "off",
"unicorn/prefer-string-replace-all": "off" // Bad suggestion for old targets
},
"overrides": [
{ "files": ["Herebyfile.*", "**/__fixtures__/**"], "rules": { "no-restricted-globals": "off" } },
{
"files": ["**/__tests__/**"],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"no-restricted-globals": "off",
"ava/no-import-test-files": "off"
}
}
],
"ignorePatterns": ["**/dist/**", "**/node_modules/**", "bin/**", "coverage/**"]
}