-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
154 lines (153 loc) · 4.4 KB
/
.eslintrc.json
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
151
152
153
154
{
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks"
],
"extends": [
"airbnb",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
"browser": true,
"es2021": true
},
"globals": {
"cy": true,
"before": true,
"beforeEach": true,
"describe": true,
"document": true,
"window": true,
"it": true,
"expect": true,
"appPackage": true,
"Cypress": true
},
"settings": {
"import/core-modules": ["@dhis2/d2-i18n", "react"],
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
},
"import/ignore": [
"node_modules",
".(json|css)$"
]
},
"rules": {
"indent": [2, 4],
"complexity": "off",
"no-prototype-builtins": "off",
"no-redeclare": "error",
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"jsx-quotes": ["error", "prefer-single"],
"no-console": ["error", {
"allow": ["warn", "error"]
}],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
],
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-return-assign": ["error", "except-parens"],
"react/jsx-indent": [1, 4],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"implicit-arrow-linebreak": "off",
"react/jsx-indent-props": [2, 4],
"react/prefer-es6-class": [1, "always"],
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
"react/no-unused-prop-types": [2, { "skipShapeProps": true }],
"react/forbid-prop-types": [0],
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"no-param-reassign": 0,
"react/prop-types": 0,
"import/prefer-default-export": 0,
"react/prefer-stateless-function": 0,
"no-unused-expressions": 0,
"linebreak-style": "off",
"@typescript-eslint/no-unused-vars": "error",
"react/jsx-no-bind": 0,
"react/require-default-props": 0,
"react/jsx-curly-brace-presence": 0,
"react/function-component-definition": 0,
"@typescript-eslint/no-empty-function": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/*.test.js",
"cypress/**",
"cypress.config.ts"
],
"optionalDependencies": false,
"peerDependencies": true
}
],
"react/button-has-type": 0,
"react/sort-comp": [
2,
{
"order": [
"static-methods",
"type-annotations",
"lifecycle",
"everything-else",
"render"
],
"groups": {
"lifecycle": [
"displayName",
"propTypes",
"contextTypes",
"childContextTypes",
"mixins",
"statics",
"defaultProps",
"constructor",
"getDefaultProps",
"getInitialState",
"state",
"getChildContext",
"UNSAFE_componentWillMount",
"componentDidMount",
"UNSAFE_componentWillReceiveProps",
"shouldComponentUpdate",
"UNSAFE_componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount"
]
}
}
],
"eol-last": ["error", "always"],
"react-hooks/exhaustive-deps": "error",
"object-curly-newline": [
"error",
{
"ObjectExpression": { "multiline": true, "minProperties": 3 },
"ObjectPattern": { "multiline": true, "minProperties": 4 },
"ImportDeclaration": "never",
"ExportDeclaration": { "multiline": true, "minProperties": 3 }
}
],
"max-len": ["error", { "code": 150 }],
"no-shadow": "off",
"react/jsx-props-no-spreading": "off",
"camelcase": "off",
"import/extensions": ["error", "never"]
}
}