Repository navigation
Expand file tree
/
Copy pathbiome.jsonc
More file actions
272 lines (272 loc) · 11.7 KB
/
Copy pathbiome.jsonc
File metadata and controls
272 lines (272 loc) · 11.7 KB
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
{
// Biome as the repository's linter and formatter
// (builder/PLAN-TOOLING-REVIEW.md, decision 4). The linter runs the rules
// that find defects -- the correctness and suspicious groups -- and nothing
// about style; the formatter owns style, set to the style most of the tree
// was already written in. scripts/check_lint.mjs runs this configuration.
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"root": true,
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"files": {
"includes": [
"builder/**/*.mjs",
"scripts/**/*.mjs",
"lib/**/*.mjs",
"book/**/*.mjs",
"book/lib/progress-handler.js",
"eval/**/*.mjs",
"wisdom/**/*.mjs",
"indexer/**/*.mjs",
"test/**/*.mjs",
"docs/assets/js/*.js",
// Vendored code, and the two pagedjs-cli ports the review treats as
// vendored: attributed and unmodified.
"!builder/vendor",
"!book/lib/paged.browser.js",
"!book/lib/outline.mjs",
"!book/lib/postprocesser.mjs",
// Copied byte for byte from the launcher repository and changed only
// there (its VENDORED.md), so its style is that repository's.
"!scripts/lib/llvm-cache",
// Workflow scripts, not modules: the agent Workflow engine runs each as
// a function body, so it ends in a top-level `return`, which no module
// parser accepts. check_regex_safety.mjs still reads their regexes,
// through acorn's allowReturnOutsideFunction.
"!wisdom/extract/workflow.mjs",
"!indexer/draft/workflow.mjs",
// Trees the gates read as data.
"!test/fixtures"
]
},
// Each setting is the one that changes the fewest lines of the tree as it
// was written. Comments are never reflowed; they stay wrapped at 80 columns
// by hand. Line endings are LF in every checkout (.gitattributes).
"formatter": { "enabled": true, "indentStyle": "space", "indentWidth": 2, "lineWidth": 120, "lineEnding": "lf" },
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "all",
"arrowParentheses": "always",
"bracketSpacing": true
}
},
"assist": { "enabled": false },
"linter": {
"enabled": true,
"rules": {
"preset": "none",
// A name a module uses but never declares or imports. Off in the
// recommended set; a function moved to a module of its own without its
// imports passed every gate until the script ran.
"correctness": { "preset": "recommended", "noUndeclaredVariables": "error" },
"suspicious": {
"preset": "recommended",
// `while ((m = re.exec(s)))` is how this tree walks a regex's matches.
"noAssignInExpressions": "off",
// Strings here hold GitHub Actions, PowerShell and JavaScript source
// whose `${...}` is meant literally.
"noTemplateCurlyInString": "off"
}
}
},
"overrides": [
{
// Functions these hand to puppeteer's page.evaluate run in the page,
// after axe-core has been injected into it as the global `axe`.
"includes": ["scripts/lib/axe-scan.mjs", "scripts/check_axe_patch_equiv.mjs"],
"javascript": { "globals": ["axe"] }
},
{
// Loaded into the book's page by pagedjs, which defines `Paged`.
"includes": ["book/lib/progress-handler.js"],
"javascript": { "globals": ["Paged"] }
},
{
// The Chrome extension's own files, which run with its API.
"includes": ["scripts/svgshot/chrome/**"],
"javascript": { "globals": ["chrome"] }
},
{
// ES5-style scripts that ship to readers as written.
// A trailing comma after a call's last argument is ES2017.
"includes": ["docs/assets/js/*.js"],
"javascript": { "formatter": { "trailingCommas": "es5" } },
"linter": { "rules": { "correctness": { "noInnerDeclarations": "off" } } }
},
{
// builder/ must not depend on scripts/. check_tree_fresh.mjs watches
// docs/ and builder/ as the inputs that decide the built bytes, and would
// not see a change to a module the build imported from scripts/. Biome
// files the rule under style; here it guards a dependency. The one
// exception is scripts/impexp.mjs, which builder/addin-project.mjs packs
// the help add-in's project file with: it imports nothing, the build
// already publishes it, and check_tree_fresh.mjs watches it by name.
//
// `paths` is the other rule here: no task of the build starts a thread
// (WIP.Build.md, "No task starts a thread"). The lanes are the build's
// threads, and work that should run in parallel is split into lane
// tasks (builder/fan-out.mjs), so that the scheduler places it and the
// Gantt chart shows it. So nothing in builder/ may import
// worker_threads or cluster, start a process, or put CPU work on
// Node's thread pool, which is what zlib's functions do unless their
// name ends in Sync. The overrides after this one name the files that
// may: each repeats `patterns`, since an override replaces the rule's
// options whole.
"includes": ["builder/**/*.mjs"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": ["**/scripts/**", "!**/scripts/impexp.mjs"],
"message": "builder/ must not depend on scripts/."
}
],
"paths": {
"node:worker_threads": "No task starts a thread: split the work into lane tasks (builder/fan-out.mjs). Only worker-pool.mjs and cpu-worker.mjs import worker_threads.",
"worker_threads": "No task starts a thread: split the work into lane tasks (builder/fan-out.mjs). Only worker-pool.mjs and cpu-worker.mjs import worker_threads.",
"node:cluster": "No task starts a process: split the work into lane tasks (builder/fan-out.mjs).",
"cluster": "No task starts a process: split the work into lane tasks (builder/fan-out.mjs).",
"node:child_process": "No task starts a process for its work: split it into lane tasks (builder/fan-out.mjs). Only build-info.mjs and addin-project.mjs run a program, git.",
"child_process": "No task starts a process for its work: split it into lane tasks (builder/fan-out.mjs). Only build-info.mjs and addin-project.mjs run a program, git.",
"node:zlib": {
"allowImportNames": [
"constants",
"crc32",
"deflateSync",
"deflateRawSync",
"inflateSync",
"inflateRawSync",
"gzipSync",
"gunzipSync",
"unzipSync",
"brotliCompressSync",
"brotliDecompressSync"
],
"message": "Import zlib's Sync functions by name: the others run on Node's thread pool, outside the lanes. Split CPU work into lane tasks (builder/fan-out.mjs)."
},
"zlib": "Import from node:zlib, by name."
}
}
}
}
}
}
},
{
// The two modules that are the lanes: the pool that starts them, and
// the harness each one runs.
"includes": ["builder/worker-pool.mjs", "builder/cpu-worker.mjs"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": ["**/scripts/**", "!**/scripts/impexp.mjs"],
"message": "builder/ must not depend on scripts/."
}
],
"paths": {
"node:cluster": "No task starts a process: split the work into lane tasks (builder/fan-out.mjs).",
"node:child_process": "No task starts a process for its work: split it into lane tasks (builder/fan-out.mjs).",
"node:zlib": "The lanes' own modules deflate nothing: import the module that does."
}
}
}
}
}
}
},
{
// The two modules that run a program: git, for the build's commit and
// for the files the add-in's project file packs.
"includes": ["builder/build-info.mjs", "builder/addin-project.mjs"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": ["**/scripts/**", "!**/scripts/impexp.mjs"],
"message": "builder/ must not depend on scripts/."
}
],
"paths": {
"node:worker_threads": "No task starts a thread: split the work into lane tasks (builder/fan-out.mjs).",
"node:cluster": "No task starts a process: split the work into lane tasks (builder/fan-out.mjs).",
"node:zlib": "These modules deflate nothing: import the module that does."
}
}
}
}
}
}
},
{
// lib/ holds modules every other part of the tooling may import
// (lib/README.md), so it imports none of them; a lib/ module that reached
// into scripts/ would take builder/ there with it.
//
// The build imports lib/, so the thread rule above holds here for what
// lib/ uses today: no thread of its own, and zlib's Sync functions by
// name. A tool outside the build that needs a thread starts it in its
// own module, not in lib/.
"includes": ["lib/**/*.mjs"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": [
"**/builder/**",
"**/scripts/**",
"**/book/**",
"**/eval/**",
"**/wisdom/**",
"**/indexer/**",
"**/test/**"
],
"message": "lib/ must not import builder/, scripts/, book/, eval/, wisdom/, indexer/ or test/."
}
],
"paths": {
"node:worker_threads": "lib/ starts no thread: the build imports it, and no task of the build starts a thread (WIP.Build.md).",
"worker_threads": "lib/ starts no thread: the build imports it, and no task of the build starts a thread (WIP.Build.md).",
"node:zlib": {
"allowImportNames": [
"constants",
"crc32",
"deflateSync",
"deflateRawSync",
"inflateSync",
"inflateRawSync",
"gzipSync",
"gunzipSync",
"unzipSync",
"brotliCompressSync",
"brotliDecompressSync"
],
"message": "Import zlib's Sync functions by name: the others run on Node's thread pool, outside the build's lanes (WIP.Build.md, \"No task starts a thread\")."
},
"zlib": "Import from node:zlib, by name."
}
}
}
}
}
}
}
]
}