forked from binary-com/deriv-developers-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
116 lines (113 loc) · 3.75 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
/* eslint-disable */
module.exports = {
env: {
browser: true,
es6: true,
es2021: true,
node: true,
cypress: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
rules: {
"react/react-in-jsx-scope": "off",
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": [
0, // TODO: we should turn this to error after we sorted our import orders.
{
groups: [["builtin", "external"], "internal", "sibling", "parent"],
"newlines-between": "ignore",
},
],
"import/prefer-default-export": 0,
"import/extensions": ["warn", "never", { jsx: "never", json: "always" }],
"no-sequences": ["warn"],
// 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/no-unescaped-entities": 0,
// "react/sort-prop-types" : ["error", { ignoreCase: true, sortShapeProp: true }],
},
};