-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
129 lines (128 loc) · 3.03 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
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
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
impliedStrict: true,
jsx: true,
modules: true
}
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'standard'
],
settings: {
react: {
version: 'detect'
}
},
env: {
es6: true,
mocha: true,
node: true
},
// ADD ANY GLOBALS HERE!
globals: {
},
rules: {
quotes: [2, 'single', { avoidEscape: true }],
'no-template-curly-in-string': 2,
'no-extra-parens': [1, 'all'],
'no-misleading-character-class': 1,
'no-prototype-builtins': 1,
'no-async-promise-executor': 1,
'no-await-in-loop': 0, // should probably be on for perf dependent application
'require-atomic-updates': 1,
// best practices
'accessor-pairs': 1,
'array-callback-return': 0, // this best practice calls out the use of map over forEach
'class-methods-use-this': 1,
'complexity': [1, 9],
'curly': [1, 'multi-or-nest', 'consistent'],
'dot-location': [2, 'property'],
'no-empty-function': 1,
'no-eval': 2,
'no-extend-native': 1,
'no-extra-bind': 1,
'no-implicit-coercion': 1,
'no-implicit-globals': 2,
'no-implied-eval': 2,
'no-lone-blocks': 1,
'no-loop-func': 1,
'no-magic-numbers': 0, // could be useful?
'no-new': 1,
'no-new-func': 2,
'no-new-wrappers': 1,
'no-param-reassign': 2,
'no-redeclare': [2, { 'builtinGlobals': true }],
'no-shadow': [2, {
'builtinGlobals': true,
'allow': [
'done',
'resolve',
'reject',
'cb' // x could potentially be added
]
}],
'no-return-await': 1,
'no-script-url': 1,
'no-self-compare': 1,
'no-sequences': 1,
'no-throw-literal': 2,
'no-unmodified-loop-condition': 1,
'no-useless-call': 1,
'no-useless-catch': 1,
'no-useless-concat': 2,
'no-useless-escape': 2,
'no-useless-return': 0,
'no-console': ['error', {
allow: [
'warn',
'error',
'info'
]
}],
'no-warning-comments': [1, {
terms: [
'fixme',
'todo',
'note'
],
location: 'anywhere' // useful to highlight comments that need addressing
}],
'require-await': 1,
'vars-on-top': 2,
'wrap-iife': [2, 'inside'],
// strict mode
'strict': [2, 'safe'],
// variables
'no-use-before-define': [2, {
variables: true,
functions: true,
classes: true
}],
// node
'handle-callback-err': 1,
'no-buffer-constructor': 2,
'no-mixed-requires': 2,
'no-new-require': 0,
'no-path-concat': 1,
'no-sync': 1,
'class-methods-use-this': [1, {
'exceptMethods': [
'componentDidMount',
'componentDidUpdate',
'componentWillMount',
'componentWillReceiveProps',
'componentWillUnmount',
'componentWillUpdate',
'render',
'shouldComponentUpdate',
]
}]
// stylistic (leaving up to standard)
// ECMAScript 6 (tbd)
}
}