forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
102 lines (99 loc) · 3.61 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
module.exports = {
root: true,
parser: 'babel-eslint',
plugins: ['prettier'],
env: {
es6: true,
browser: true,
amd: true,
mocha: true,
jest: true,
jquery: true,
jasmine: true,
},
globals: {
dataLayer: true,
texts_json: false,
},
rules: {
camelcase: 0,
// semi : ['error', 'always'],
'array-callback-return': 0,
'arrow-body-style': 0,
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
curly: 0,
// 'comma-dangle' : ['error', 'always-multiline'],
'eol-last': ['error', 'always'],
'func-names': ['error', 'never'],
'key-spacing': 0,
'max-classes-per-file': ['warn', 2],
// 'keyword-spacing' : ['error', { after: true }],
'lines-between-class-members': 0,
indent: 0,
// 'max-len' : ['error', { code: 120, 'ignoreComments': true }],
// 'no-extra-semi' : 'error',
'no-console': 'error',
'no-else-return': ['error', { allowElseIf: true }],
'no-multi-assign': 0,
// 'no-multi-spaces' : [2, { exceptions: { 'BinaryExpression': true, 'VariableDeclarator': true, 'ImportDeclaration': true } }],
'no-param-reassign': ['error', { props: false }],
'no-restricted-globals': 0,
'no-script-url': 0,
// 'no-trailing-spaces' : ['error', { skipBlankLines: true }],
// 'object-curly-spacing' : ['error', 'always', { arraysInObjects: true, objectsInObjects: true }],
'one-var': ['error', { initialized: 'never', uninitialized: 'always' }],
'prefer-destructuring': 0,
quotes: 0,
// 'space-in-parens' : ['error', 'never'],
'space-infix-ops': 'error',
// 'space-unary-ops' : 'error',
// 'no-multiple-empty-lines' : ['error', { 'max': 1, 'maxEOF': 1 }],
// import rules
'import/no-extraneous-dependencies': ['error', { 'devDependencies': ['**/__tests__/**/*.js', '**/test*.js', '**/*.test.js*', '**/*.spec.js', '**/*.spec.jsx'] }],
'import/no-useless-path-segments': 'error',
'import/order': [
'error',
{
groups: [['builtin', 'external'], 'internal', 'sibling', 'parent'],
'newlines-between': 'ignore',
},
],
'import/prefer-default-export': 0,
'import/extensions': ['error', 'never', { jsx: 'always', json: 'always' }],
'import/no-unresolved': [
2,
{ ignore: ['@deriv/components', '@deriv/shared'] },
],
// react rules
// 'jsx-quotes' : ['error', 'prefer-single'],
// 'react/jsx-closing-bracket-location': ['error', { selfClosing: 'line-aligned', nonEmpty: 'line-aligned' }],
// 'react/jsx-closing-tag-location' : 'error',
// 'react/jsx-first-prop-new-line' : ['error', 'multiline-multiprop'],
// 'react/jsx-indent' : ['error', 4],
// 'react/jsx-indent-props' : ['error', 4],
// 'react/jsx-max-props-per-line' : ['error', { when: 'multiline' }],
// 'react/jsx-tag-spacing' : ['error', { closingSlash: 'never', beforeSelfClosing: 'always' }],
'react/prop-types': 0,
'react/self-closing-comp': 'error',
// 'react/sort-prop-types' : ['error', { ignoreCase: true, sortShapeProp: true }],
},
extends: [
'prettier',
'prettier/react',
'airbnb-base',
'binary',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: '16',
},
},
};