This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 922
/
.eslintrc
147 lines (138 loc) · 4.19 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
ecmaFeatures:
jsx: true
env:
node: true
amd: true
builtin: true
mocha: true
jasmine: false
es6: true
globals:
importScripts: true
document: true
window: true
location: true
navigator: true
console: true
Worker: true
postMessage: true
setTimeout: true
clearTimeout: true
setInterval: true
clearInterval: true
Blob: true
XMLHttpRequest: true
localStorage: true
requestAnimationFrame: true
KeyboardEvent: true
onload: true # for tests
btoa: true
atob: true
apf: true
alert: true
prompt: true
Image: true
URL: true
FileReader: true
FileReaderSync: true
WebSocket: true
sessionStorage: true
localStorage: true
plugins:
- react
extends:
- eslint:recommended
- plugin:react/recommended
rules:
handle-callback-err: 1
max-len: [1, 140, 4, { ignorePattern: "\": " }]
no-debugger: 1
no-undef: 1
no-inner-declarations: [1, "functions"]
no-native-reassign: 1
no-new-func: 1
no-new-wrappers: 1
no-cond-assign: [1, "except-parens"]
no-dupe-keys: 1
no-eval: 1
no-console: 0
no-func-assign: 1
no-invalid-regexp: 1
no-irregular-whitespace: 1
no-negated-in-lhs: 1
no-regex-spaces: 1
no-unreachable: 1
use-isnan: 1
valid-typeof: 1
no-redeclare: 1
no-with: 1
radix: 1
no-delete-var: 1
no-label-var: 1
no-shadow-restricted-names: 1
no-new-require: 1
no-unused-vars: [1, {vars: "all", args: "none"}]
semi: 1
no-extra-semi: 1
one-var: [1, "never"]
arrow-parens: 1
no-confusing-arrow: 1
camelcase: [1, { properties: "never" }]
id-blacklist: [1, "uname", "cb", "acct"]
default-case: 1
// DISABLED: too much old code still uses this, e.g. for strings that should really be numbers
// eqeqeq: [1, "smart"]
// React rules
react/jsx-curly-spacing: 1
react/no-deprecated: 1
react/no-did-mount-set-state: 1
react/no-did-update-set-state: 1
react/no-direct-mutation-state: 1
react/no-is-mounted: 1
react/no-unknown-property: 1
react/prefer-es6-class: 1
react/prop-types: 1
react/react-in-jsx-scope: 1
react/self-closing-comp: 1
react/sort-comp: 1
# This rule is not compatible with eslint < 3
# react/jsx-wrap-multilines: 1
react/jsx-boolean-value: [1, "always"]
react/jsx-equals-spacing: 1
react/jsx-indent-props: 1
react/jsx-key: 1
react/jsx-indent: 1
react/jsx-max-props-per-line: [1, { maximum: 5 }]
react/jsx-no-bind: 1
react/jsx-no-duplicate-props: 1
react/jsx-no-undef: 1
react/jsx-pascal-case: 1
react/jsx-uses-react: 1
keyword-spacing: [1, {"before": true, "after": true, "overrides": { "catch": {"after": true } }}]
key-spacing: [1, { beforeColon: false, afterColon: true, mode: "strict" }]
space-in-parens: [1, "never"]
space-infix-ops: [1]
arrow-spacing: 1
generator-star-spacing: [1, {"before": false, "after": true}]
space-before-blocks: [1, "always"]
// TODO: after eslint update in IDE
// space-before-function-paren: [1, {"named": "never", "anonymous": "ignore"}]
// object-curly-newline: [1, { ObjectExpression: { "multiline": true }, "ObjectPattern": "never" }]
// DISABLED: causes issue with define(function() in client-side code
// indent: [1, 4, { SwitchCase: 1, outerIIFEBody: 0, MemberExpression: 1, FunctionDeclaration: { body: 0, parameters: 1 }, FunctionExpression: { body: 0, parameters: 1 } }]
object-curly-spacing: [1, "always", { objectsInObjects: false, arraysInObjects: false }]
// DISABLED: causes issue with /*** single-line, triple-star comments ***/
// spaced-comment: [1, "always", { exceptions: ["*"] }]
comma-spacing: 1
no-multi-spaces: 1
no-lone-blocks: 1
// valid-jsdoc: [1, { requireReturn: false, requireParamDescription: false, prefer: { "return": "return" } }]
no-empty: [1, {"allowEmptyCatch": true}]
no-useless-escape: [0] // broken for regexps
no-ex-assign: 0
no-fallthrough: 0
no-sparse-arrays: 0
no-control-regex: 0
no-unsafe-finally: 0
no-mixed-spaces-and-tabs: 0
no-constant-condition: [1, { "checkLoops": false }]