-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
91 lines (82 loc) · 2.29 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
module.exports = {
extends: ['airbnb', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
impliedStrict: true,
classes: true,
},
},
env: {
browser: true,
node: true,
jquery: true,
jest: true,
mocha: true,
},
globals: {
page: true,
browser: true,
context: true,
jestPuppeteer: true,
chrome: true,
},
rules: {
// spent 2 hours to fix a bug because of rewriting & to &&
// needed a bitwise operator & not && in some case
'no-bitwise': 0,
'no-underscore-dangle': ['error', { allow: ['_id'] }],
// we have multiple "for with async await" and functions cases
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'no-loop-func': 'off',
// only required for some testing
'no-unused-expressions': 0,
// some algorithm uses this
'no-plusplus': 0,
// TODO: Ignoring this until we find a way to ignore devDepencies for "tests"
'import/no-extraneous-dependencies': 0,
// we have multiple methods without 'this'
// but will obviously fail with static
'class-methods-use-this': 0,
// TODO: come back to these rules and apply them for more stable version
'consistent-return': 0,
'no-return-assign': 0,
'react/require-default-props': 0,
'import/prefer-default-export': 0,
'jsx-a11y/no-autofocus': 0,
'react/jsx-props-no-spreading': 0,
// TODO: This is for action-engine-dashboard only. We must remove this.
'react/prop-types': 0,
'react/jsx-filename-extension': [
1,
{
extensions: ['.js', '.jsx'],
},
],
// these are simple formatting, like space, quotes etc.
quotes: [
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
'prettier/prettier': [
'error',
{
trailingComma: 'es5',
singleQuote: true,
printWidth: 80,
},
],
// TODO: probably should use a debugging tool instead
'no-console': ['error', { allow: ['warn', 'error'] }],
// NOTE: these two rules must not be removed if we are using hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
plugins: ['html', 'prettier', 'react-hooks'],
};