-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
150 lines (145 loc) · 4.06 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
env: {
browser: true,
jest: true
},
globals: {
window: true
},
extends: ['airbnb'],
rules: {
// Need to be enabled later
'no-console': 'off',
'no-continue': 'off',
'no-new': 'off',
'no-restricted-syntax': 'off',
'no-unneeded-ternary': 'off',
'no-use-before-define': 'off',
'prefer-destructuring': [
'error',
{
array: false,
object: true
}
],
'import/prefer-default-export': 'off',
'react/jsx-fragments': 'off',
'react/no-access-state-in-setstate': 'off',
'react/no-array-index-key': 'off',
'react/no-danger': 'off',
'react/no-deprecated': 'off',
'react/no-string-refs': 'off',
'react/no-unescaped-entities': 'off',
'react/no-unused-state': 'off',
'react/prefer-stateless-function': 'off',
'react/sort-comp': 'off',
'react/react-in-jsx-scope': 'off',
// Turning off few recommended rules
'arrow-body-style': 'off',
camelcase: 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'func-names': 'off',
'global-require': 'off',
'guard-for-in': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-return-assign': 'off',
'no-shadow': 'off',
'no-underscore-dangle': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'one-var': 'off',
'prefer-arrow-callback': 'off',
'prefer-const': 'off',
'prefer-object-spread': 'off',
'prefer-rest-params': 'off',
strict: 'off',
'vars-on-top': 'off',
yoda: 'off',
'import/extensions': 'off',
'import/no-dynamic-require': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/no-useless-path-segments': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-boolean-value': 'off',
'react/jsx-closing-tag-location': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-wrap-multilines': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-no-bind': 'off',
'react/no-did-update-set-state': 'off',
'react/prop-types': 'off',
'react/require-default-props': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
// Additional Eslint rules
'max-len': ['off', { code: 100 }],
'prefer-promise-reject-errors': ['off'],
'space-unary-ops': [
'error',
{
words: true,
nonwords: false
}
],
'func-call-spacing': ['error', 'never'],
'eol-last': ['error', 'always'],
'no-alert': 'warn',
eqeqeq: ['error', 'always'],
'no-eq-null': 'error',
'no-trailing-spaces': 'error',
'no-multi-spaces': 'error',
'array-bracket-spacing': ['error', 'never'],
'object-curly-spacing': ['warn', 'always'],
'no-multiple-empty-lines': ['warn', { max: 1, maxEOF: 1 }],
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}
],
'comma-dangle': ['error', 'never'],
'comma-spacing': ['error', { before: false, after: true }],
'space-before-blocks': 'error',
'space-in-parens': ['error', 'never'],
'object-shorthand': ['error', 'always', { avoidQuotes: true }],
'space-infix-ops': 'error',
'brace-style': 'error',
'key-spacing': ['error', { beforeColon: false }],
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true }
]
},
overrides: [
// node files
{
files: ['.eslintrc.js', 'scripts/**/*.js', 'config/**/*.js'],
parserOptions: {
sourceType: 'script'
},
env: {
browser: false,
node: true
}
}
]
};