You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/biome_analyze/CONTRIBUTING.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1207,21 +1207,47 @@ The documentation needs to adhere to the following rules:
1207
1207
1208
1208
You should usually prefer to show a concise but complete sample snippet instead.
1209
1209
1210
+
-**Multi-file snippets**
1211
+
1212
+
For rules that analyze relationships between multiple files (e.g., import cycles, cross-file dependencies), you can use the `file=<path>` property to create an in-memory file system for testing.
1213
+
1214
+
Files are organized by documentation section (Markdown headings), where all files in a section are collected before any tests run. This ensures each test has access to the complete file system regardless of definition order.
1215
+
1216
+
````rust
1217
+
/// ### Invalid
1218
+
///
1219
+
/// **`foo.js`**
1220
+
/// ```js,expect_diagnostic,file=foo.js
1221
+
/// import { bar } from "./bar.js";
1222
+
/// export function foo() {
1223
+
/// return bar();
1224
+
/// }
1225
+
/// ```
1226
+
///
1227
+
/// **`bar.js`**
1228
+
/// ```js,expect_diagnostic,file=bar.js
1229
+
/// import { foo } from "./foo.js";
1230
+
/// export function bar() {
1231
+
/// return foo();
1232
+
/// }
1233
+
/// ```
1234
+
````
1235
+
1210
1236
-**Ordering of code block properties**
1211
1237
1212
-
In addition to the language, a code block can be tagged with a few additional properties like `expect_diagnostic`, `options`, `full_options`, `use_options`and/or `ignore`.
1238
+
In addition to the language, a code block can be tagged with a few additional properties like `expect_diagnostic`, `options`, `full_options`, `use_options`, `ignore`and/or `file=<path>`.
1213
1239
1214
1240
The parser does not care about the order, but for consistency, modifiers should always be ordered as follows:
0 commit comments