-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbiome.jsonc
227 lines (226 loc) · 7.32 KB
/
biome.jsonc
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"defaultBranch": "master"
},
"extends": ["@chainsafe/biomejs-config", "@chainsafe/biomejs-config/recommended", "@chainsafe/biomejs-config/esm"],
"files": {
"include": ["packages/*/src/**/*.ts", "packages/*/src/**/*.tsx", "packages/*/test/**/*.ts"]
},
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "off"
},
"style": {
// Our team does not like this syntax
// https://github.com/ChainSafe/ssz/pull/475#discussion_r1995814916
"useNumberNamespace": "off",
// TODO: There are two many usages, will fix in separate PR
"noUselessElse": "off",
// TODO: There are two many usages, will fix in separate PR
"noParameterAssign": "off",
// We use to export types and object without differentiating
"useExportType": "off",
// We use to import types and object without differentiating
"useImportType": "off",
// We have a lot of enum members in camelCase, so we have to update
// the base naming convention to allow camelCase in addition to PascalCase
"useNamingConvention": {
"level": "error",
"options": {
"requireAscii": true,
"strictCase": false,
"conventions": [
{
"selector": {
"kind": "enumMember"
},
"formats": ["camelCase", "PascalCase"]
}
]
}
}
}
}
},
"overrides": [
{
"include": ["packages/ssz/src/**/*.ts", "packages/ssz/test/**/*.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": {
"level": "error",
"options": {
"requireAscii": true,
"strictCase": false,
"conventions": [
// We have a lot of functions containing `_` e.g. value_toTree, tree_deserializeFromBytes,
// which could not be considered as some standard case
{
"selector": {
"kind": "classMethod"
},
"match": "[a-z][a-zA-Z0-9_]*"
},
// We have a lot of functions containing `_` e.g. value_getBlocksBytesArrayComposite
// which could not be considered as some standard case
{
"selector": {
"kind": "function"
},
"match": "[a-z][a-zA-Z0-9_]*"
},
// We have a lot of functions containing `_` e.g. tree_setChunksNode
// which could not be considered as some standard case
{
"selector": {
"kind": "typeMethod"
},
"match": "[a-z][a-zA-Z0-9_]*"
},
// A lof of types are PascalCase and few mixing up _ in those
// e.g. TreeViewDU, TreeView_DU, Metadata: Metadata
{
"selector": {
"kind": "typeProperty"
},
"match": "[a-zA-Z0-9_]*"
},
// We have a lot enum declarations with camelCase members
{
"selector": {
"kind": "enumMember"
},
"formats": ["camelCase", "PascalCase"]
},
// We have a lot of type parameters with capital cases
// e.g. CompositeType<V, TV, TVDU>
{
"selector": {
"kind": "typeParameter"
},
"formats": ["camelCase", "PascalCase", "CONSTANT_CASE"]
},
// We declare properties as class instances matching names
// e.g. protected readonly TreeViewDU: ContainerTreeViewDUTypeConstructor<Fields>;
{
"selector": {
"kind": "classProperty"
},
// name can start with `_` and rest of the name
// should mach the formats given below
"match": "(?:_?)(.*)",
"formats": ["camelCase", "PascalCase"]
},
// All our SSZ Type declarations are defined as PascalCase e.g. BeaconBlockBody: altair.BeaconBlockBody,
// some are even constant case e.g. HYSTERESIS_QUOTIENT: 4,
// Some are mix of all e.g. set_exitEpoch_and_hashTreeRoot: (tb) => {
{
"selector": {
"kind": "objectLiteralProperty"
},
"match": "[a-zA-Z0-9_]*"
}
]
}
}
}
}
}
},
{
"include": ["packages/ssz/test/**/*.ts"],
"linter": {
"rules": {
"suspicious": {
// We use `any` a lot often during tests
"noExplicitAny": "off"
}
}
}
},
{
"include": ["packages/as-sha256/src/**/*.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": {
"level": "error",
"options": {
"requireAscii": true,
"strictCase": false,
"conventions": [
{
"selector": {
"kind": "objectLiteralProperty"
},
"formats": ["camelCase", "PascalCase", "CONSTANT_CASE"]
}
]
}
}
}
}
}
},
{
/// We want to preserve variable names in this file
"include": ["packages/persistent-merkle-tree/src/hasher/as-sha256.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": {
"level": "off"
}
}
}
}
},
{
"include": ["packages/ssz/test/unit/specTestYamlLoader.test.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": {
"level": "error",
"options": {
"requireAscii": true,
"strictCase": false,
"conventions": [
{
"selector": {
"kind": "objectLiteralProperty"
},
"formats": ["camelCase", "snake_case"]
}
]
}
}
}
}
}
},
{
"include": ["packages/*/src/**/*.tsx"],
"linter": {
"rules": {
// Disable all accessibility rules for React files
"a11y": {
"useValidAnchor": "off",
"noLabelWithoutControl": "off",
"useButtonType": "off",
"useKeyWithClickEvents": "off",
"useAnchorContent": "off",
"useAltText": "off"
}
}
},
// Add JSX support for React files
"javascript": {
"globals": ["JSX"]
}
}
]
}