-
Notifications
You must be signed in to change notification settings - Fork 89
/
biome.jsonc
160 lines (160 loc) · 4.15 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
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignore": [
".next",
"mockServiceWorker.js",
"*-props.json",
".tmp",
"package.json",
"site/src/components/css-display/*.json",
"site/public/search-data.json"
]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
// Changed to warn because we have a lot of non-null assertions.
"noNonNullAssertion": "warn"
},
"complexity": {
// Changed to warn because it is useful to keep this in mind, but it doesn't need to be a strict requirement.
"noForEach": "warn"
},
"a11y": {
// Disabled because autofocus is necessary in some cases.
"noAutofocus": "off",
// Disabled because we write a lot of custom components.
"noNoninteractiveElementToInteractiveRole": "off",
"useFocusableInteractive": "off",
"noNoninteractiveTabindex": "off",
// Disabled until biome doesn't flag hidden SVGs.
"noSvgWithoutTitle": "off",
// Changed to warn because biome has some false positives.
"useAriaPropsForRole": "warn",
"useSemanticElements": "off"
},
"correctness": {
"noUnusedImports": "error",
"useExhaustiveDependencies": {
"level": "warn",
"options": {
"hooks": [
{
"name": "useIsomorphicLayoutEffect",
"closureIndex": 0,
"dependenciesIndex": 1
},
{
"name": "useControlled",
"stableResult": [1]
}
]
}
}
},
"suspicious": {
// Changed to warn because it is useful to keep this in mind, but it doesn't need to be a strict requirement.
"noArrayIndexKey": "warn",
// Changed to warn because it is useful to keep this in mind, but it doesn't need to be a strict requirement.
"noExplicitAny": "warn"
}
}
},
"css": {
"formatter": {
"lineWidth": 200
},
"parser": {
"cssModules": true
}
},
"overrides": [
{
// Disable some rules for tests and stories, because they are not production code.
"include": ["__tests__/**", "stories/**"],
"linter": {
"rules": {
"a11y": {
"useButtonType": "off"
},
"complexity": {
"noForEach": "off"
},
"suspicious": {
"noImplicitAnyLet": "off"
}
}
}
},
{
// Disable some rules for legacy code, because it is not worth fixing.
"include": [
"lab/src/responsive/**",
"packages/data-grid/**",
"lab/src/common-hooks/**"
],
"linter": {
"rules": {
"style": {
"noParameterAssign": "off"
},
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
},
{
// Disable noExplicitAny for utils, because any is useful in some cases.
"include": ["utils/**"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
},
{
// Disable noArrayIndexKey for layout examples because array indexes are useful in this case.
"include": [
"packages/*/stories/*-layout/**",
"site/src/examples/*-layout/**"
],
"linter": {
"rules": {
"suspicious": {
"noArrayIndexKey": "off"
}
}
}
},
{
// Disable noShadowRestrictedNames for examples and stories because it is useful to shadow restricted names for example names.
"include": ["site/src/examples/**", "packages/*/stories/**"],
"linter": {
"rules": {
"suspicious": {
"noShadowRestrictedNames": "off"
}
}
}
}
]
}