-
-
Notifications
You must be signed in to change notification settings - Fork 129
/
.eslintrc.js
103 lines (97 loc) · 2.56 KB
/
.eslintrc.js
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
module.exports = {
parser: "babel-eslint",
parserOptions: {
sourceType: "module",
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
],
plugins: ["jest", "flowtype", "graphql", "tsdoc"],
env: {
jest: true,
node: true,
es6: true,
},
globals: {
jasmine: false,
},
rules: {
"prettier/prettier": "error",
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-ignore": "allow-with-description",
},
],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
args: "after-used",
ignoreRestSiblings: true,
},
],
"no-confusing-arrow": 0,
"no-else-return": 0,
"no-underscore-dangle": 0,
"no-restricted-syntax": 0,
"no-await-in-loop": 0,
"jest/no-focused-tests": 2,
"jest/no-identical-title": 2,
"tsdoc/syntax": 2,
// Rules that we should enable:
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"no-inner-declarations": "warn",
},
settings: {
flowtype: {
onlyFilesWithFlowAnnotation: false,
},
},
overrides: [
// Rules for Flow only
{
files: ["*.js", "*.jsx"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"flowtype/boolean-style": [2, "boolean"],
"flowtype/delimiter-dangle": [2, "always-multiline"],
"flowtype/no-primitive-constructor-types": 2,
"flowtype/no-types-missing-file-annotation": 2,
"flowtype/no-weak-types": 2,
"flowtype/object-type-delimiter": [2, "comma"],
"flowtype/require-valid-file-annotation": 2,
"flowtype/semi": [2, "always"],
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
},
},
// Rules for TypeScript only
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
rules: {
"no-dupe-class-members": "off",
"no-undef": "off",
},
},
// Rules for tests only
{
files: ["**/__tests__/**/*.{ts,js}"],
rules: {
"prefer-const": "off",
"@typescript-eslint/no-unused-vars": "off",
// We don't normally care about race conditions in tests
"require-atomic-updates": "warn",
},
},
],
};