forked from BitGo/BitGoJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
98 lines (98 loc) · 3.73 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
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true,
"mocha": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "import"],
"globals": {
"app": true, // BitGo side-effect from testutil
"ethUtil": true, // BitGo side-effect from testutil
"requireCommon": true
},
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 6
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
"array-bracket-spacing": ["error", "never"],
"arrow-spacing": ["error", { "before": true, "after": true }],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": ["error", { "before": false, "after": true }],
"curly": ["error", "multi-line"],
"eol-last": "error",
"eqeqeq": ["warn", "always"],
"func-call-spacing": ["error", "never"],
"func-names": "off",
"indent": ["warn", 2, { "SwitchCase": 1, "MemberExpression": 1 }],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "strict" }],
"keyword-spacing": ["error"],
"linebreak-style": ["error", "unix"],
"no-compare-neg-zero": "error",
"no-console": "warn",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-imports": "error",
"no-empty": ["warn", { "allowEmptyCatch": false }],
"no-extra-boolean-cast": "off",
"no-extra-semi": "error",
"no-fallthrough": "error",
"no-inner-declarations": "off",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1 }],
"no-octal": "error",
"no-path-concat": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-redeclare": ["error", { "builtinGlobals": true }],
"no-sync": "warn",
"no-trailing-spaces": ["warn", { "skipBlankLines": true, "ignoreComments": true }],
"no-undef": "error",
"no-unneeded-ternary": "error",
"no-unreachable": "error",
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "none" }],
"no-useless-escape": "off",
"no-var": "error",
"object-curly-spacing": ["error", "always", { "objectsInObjects": true, "arraysInObjects": true }],
"prefer-const": "error",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"radix": "error",
"require-yield": "off",
"semi": ["error", "always"],
"space-before-blocks": ["error"],
"space-infix-ops": ["error"],
"spaced-comment": ["error", "always"],
"switch-colon-spacing": ["error", { "before": false, "after": true }],
"yield-star-spacing": ["error", { "before": true, "after": false }],
"import/no-internal-modules": [
"error",
{
"forbid": ["@bitgo/*/**"]
}
]
},
"overrides": [
{
// tsc already checks for usage of undefined variables better than eslint can,
// so there's no need to enable this rule for typescript files.
// https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
"files": ["*.ts"],
"rules": {
"no-undef": "off"
}
}
]
}