-
Notifications
You must be signed in to change notification settings - Fork 18
/
.eslintrc
56 lines (48 loc) · 1.58 KB
/
.eslintrc
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
{
"extends": [
// Enable eslint recommended, and the few overrides necessary to work with TS
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
// Enable recommended rules specific to TS
"plugin:@typescript-eslint/recommended",
// Enable rules that are types aware
"plugin:@typescript-eslint/recommended-requiring-type-checking",
// React rules
"plugin:react/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"project": "./tsconfig.json"
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
// Enforce `I` prefix for interfaces, as I like it that way
"@typescript-eslint/interface-name-prefix": [
"error",
{
"prefixWithI": "always",
"allowUnderscorePrefix": true
}
],
// Allow using `any`, as it's sometimes easier with external API
"@typescript-eslint/no-explicit-any": "off",
// Do not require return types on all functions, as the inference engine is good enough to figure it out
"@typescript-eslint/explicit-function-return-type": "off",
// It is convenient being able to declare functions after they're used
"@typescript-eslint/no-use-before-define": "off",
// It is erroring when declaring global functions on the window object, which is annoying
"@typescript-eslint/unbound-method": ["off"],
"@typescript-eslint/camelcase": ["error", {
"ignoreDestructuring": true,
"properties": "never"
}]
}
}