Skip to content

feat(fmt/md): ordered lists and space normalization#9998

Merged
ematipico merged 2 commits intomainfrom
feat/md-ordered-lists
Apr 16, 2026
Merged

feat(fmt/md): ordered lists and space normalization#9998
ematipico merged 2 commits intomainfrom
feat/md-ordered-lists

Conversation

@ematipico
Copy link
Copy Markdown
Member

Summary

This PR implements the formatting of ordered lists.

Prettier removes excessive spaces from paragraphs that are inside a list item. This PR implements that, but not yet for code blocks (still need to implement it).

Average compatibility: 74.22
Compatible lines: 81.77

I'd say we're really good here :)

I used AI to implement the logic of the new option for the item list and for creating new tests. I implemented the rest

I also added a small utility in the HTML formatter, creating the options for the Any* field, which isn't a great idea, because the code gen must override them. It's purely an internal refactor; it doesn't affect the functionality.

Test Plan

Added new tests. Made sure that the changes in the prettier snapshots are correct.

Docs

@ematipico ematipico requested review from a team April 15, 2026 16:00
@github-actions github-actions bot added A-Formatter Area: formatter A-Tooling Area: internal tools L-HTML Language: HTML and super languages L-Markdown Language: Markdown labels Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 53180 53180 0
Passed 51960 51960 0
Failed 1178 1178 0
Panics 42 42 0
Coverage 97.71% 97.71% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

markdown/commonmark

Test result main count This PR count Difference
Total 652 652 0
Passed 652 652 0
Failed 0 0 0
Panics 0 0 0
Coverage 100.00% 100.00% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5467 5467 0
Passed 1915 1915 0
Failed 3552 3552 0
Panics 0 0 0
Coverage 35.03% 35.03% 0.00%

ts/babel

Test result main count This PR count Difference
Total 640 640 0
Passed 569 569 0
Failed 71 71 0
Panics 0 0 0
Coverage 88.91% 88.91% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18876 18876 0
Passed 13014 13014 0
Failed 5861 5861 0
Panics 1 1 0
Coverage 68.94% 68.94% 0.00%

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Walkthrough

Refactors HTML formatter to centralise compact-mode formatting by introducing shared wrapper formatters in a new shared module and removing per-rule compact: bool options. Simultaneously augments the Markdown formatter with an inside_list propagation and new trim mode to handle list-continuation indentation/leading-space preservation, plus multiple formatters updated to pass the new options. Also adds/updates tests and grammar fixtures and minor docs and .gitignore entries.

Possibly related PRs

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main changes: implementation of ordered list formatting and space normalisation in the Markdown formatter.
Description check ✅ Passed The description is well-related to the changeset, explaining the motivation (Prettier-compatible space removal in lists), implementation details, test coverage, and even disclosing AI assistance.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/md-ordered-lists

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/biome_markdown_formatter/src/markdown/auxiliary/fenced_code_block.rs`:
- Around line 37-50: The code is removing the list continuation indent for the
opening fence (using excess derived from self.inside_list and indent.len()),
which drops the 0–3 valid fence-prefix spaces; change the logic so you only
strip the raw list-item indent when handling the closing fence (r_fence_indent)
and leave the opening fence indent untouched because check_continuation_indent
already consumed it. Concretely, in fenced_code_block.rs update the branch that
uses excess/indent (and the analogous branch at the other block ~71-85) to check
the fence side (use the closing-fence path / r_fence_indent variable) and only
iterate and write format_removed for indent when processing the closer;
otherwise write indent.format() for openers. Ensure you reference and preserve
self.inside_list, indent, and r_fence_indent in your changes.

In `@crates/biome_markdown_formatter/tests/specs/markdown/list_continuation.md`:
- Around line 1-15: Add a new ordered-list case using the marker "10." in the
existing list_continuation.md fixture to exercise multi-digit marker width
changes: insert an item labeled "10." (e.g., "10. A long first line that forces
the marker width change" with subsequent soft-wrapped continuation lines aligned
and misaligned to test both preserved and stripped-extra-space behaviors),
mirroring the patterns used by items 1–4 so the formatter hits the
continuation-indentation edge case; then add corresponding valid/invalid
snapshot entries per the project's formatting test guidelines so the formatter
behavior for multi-digit markers is covered.

In `@crates/biome_markdown_formatter/tests/specs/markdown/ordered_lists.md`:
- Around line 1-16: The ordered_lists.md fixture currently contains only
unordered (`-`) examples; update the ordered_lists.md fixture to include proper
ordered-list cases using numbered markers (`1.`, `2.` etc.), covering simple
ordered lists, nested ordered/unordered mixes, and continuation lines (list item
line breaks) so the ordered-list formatter feature is tested; mirror relevant
scenarios from list_continuation.md but with numeric markers, and ensure
examples include nested levels (e.g., "1.", "1.1"/nested numeric or "1." +
indented "-" mixes) and continuation paragraphs to validate formatting semantics
for functions that parse or render ordered lists.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9ddc0ed4-e324-41a8-b660-84934b938eed

📥 Commits

Reviewing files that changed from the base of the PR and between 4da9caf and 75b1b62.

⛔ Files ignored due to path filters (11)
  • crates/biome_markdown_formatter/tests/specs/markdown/list_continuation.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/markdown/ordered_lists.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/blockquote/code.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/blockquote/ignore-code.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/break/simple.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/code/additional-space.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/footnoteDefinition/long.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/list/indent.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/list/issue-7846.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-219.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-269.md.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (31)
  • .gitignore
  • crates/biome_html_formatter/src/html/any/attribute_initializer.rs
  • crates/biome_html_formatter/src/html/auxiliary/attribute_initializer_clause.rs
  • crates/biome_html_formatter/src/lib.rs
  • crates/biome_html_formatter/src/shared.rs
  • crates/biome_html_formatter/src/svelte/any/binding_property.rs
  • crates/biome_html_formatter/src/svelte/value/directive_value.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/autolink.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/bullet.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/document.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/fenced_code_block.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/header.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/inline_code.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/inline_image.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/inline_link.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/link_destination.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/link_label.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/link_title.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/ordered_list_item.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/paragraph.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/quote.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/reference_link.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/setext_header.rs
  • crates/biome_markdown_formatter/src/markdown/auxiliary/textual.rs
  • crates/biome_markdown_formatter/src/markdown/lists/block_list.rs
  • crates/biome_markdown_formatter/src/markdown/lists/inline_item_list.rs
  • crates/biome_markdown_formatter/src/shared.rs
  • crates/biome_markdown_formatter/tests/quick_test.rs
  • crates/biome_markdown_formatter/tests/specs/markdown/list_continuation.md
  • crates/biome_markdown_formatter/tests/specs/markdown/ordered_lists.md
  • xtask/codegen/markdown.ungram
💤 Files with no reviewable changes (1)
  • crates/biome_markdown_formatter/src/markdown/auxiliary/quote.rs

Comment thread crates/biome_markdown_formatter/tests/specs/markdown/ordered_lists.md Outdated
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 15, 2026

Merging this PR will not alter performance

✅ 95 untouched benchmarks
⏩ 161 skipped benchmarks1


Comparing feat/md-ordered-lists (86eb833) with main (ef470ba)2

Open in CodSpeed

Footnotes

  1. 161 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (245307d) during the generation of this report, so ef470ba was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Copy Markdown
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was concerned by the html formatter changes, but seems there's no snapshot diffs.

Looks good

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: 86eb833

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/biome_markdown_formatter/src/markdown/lists/inline_item_list.rs (1)

20-27: Fenced code blocks are unaffected; clarify dispatch order rationale.

The dispatch order is structurally risky (pristine/clean modes get masked by an early inside_list check), but fenced code blocks explicitly pass inside_list: false at line 63–67, so they bypass the masking. Paragraphs only set inside_list: true when inside a bullet list (via block_list.rs), and bullets pair this with trim_keep_leading_spaces(), never with pristine/clean modes.

However, the dispatch logic still reads as though inside_list should override all formatting modes. Consider documenting or restructuring to make it explicit that inside_list is specifically for list continuation indent handling, not a universal mode override.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_markdown_formatter/src/markdown/lists/inline_item_list.rs`
around lines 20 - 27, The dispatch currently checks inside_list first which can
be misread as a universal override; clarify intent by either (A) adding a
concise comment above the dispatch explaining that inside_list is only for
list-continuation indent handling (fenced code blocks intentionally pass
inside_list = false and paragraphs set inside_list only when in bullet lists via
block_list.rs so pristine/clean modes aren’t masked), or (B) reorder the checks
to evaluate print_mode variants (is_auto_link_like, is_normalize_words,
is_trim_all) before calling fmt_inside_list so the list-specific formatting only
runs when no special print_mode applies; update or add text referencing
inside_list, fmt_inside_list, fmt_auto_link_like, fmt_normalize_words,
fmt_trim_all and note the interaction with block_list.rs and fenced-code callers
to make the rationale explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/formatter-development/SKILL.md:
- Around line 163-166: The docs currently show a generic invocation "just
gen-formatter" which is incorrect; update the commands block and any references
to use the language-specific form "just gen-formatter <lang>" (e.g., replace the
listed `just gen-formatter` line and any guidance text) and add the explicit
guidance sentence "Run 'just gen-formatter <lang>' before opening a PR when
making changes to formatter implementations in *_formatter crates." to ensure
the README matches the repo workflow; look for the commands block containing
`just f`, `just l`, `just gen-formatter` and the surrounding paragraph in
SKILL.md to make this change.

---

Nitpick comments:
In `@crates/biome_markdown_formatter/src/markdown/lists/inline_item_list.rs`:
- Around line 20-27: The dispatch currently checks inside_list first which can
be misread as a universal override; clarify intent by either (A) adding a
concise comment above the dispatch explaining that inside_list is only for
list-continuation indent handling (fenced code blocks intentionally pass
inside_list = false and paragraphs set inside_list only when in bullet lists via
block_list.rs so pristine/clean modes aren’t masked), or (B) reorder the checks
to evaluate print_mode variants (is_auto_link_like, is_normalize_words,
is_trim_all) before calling fmt_inside_list so the list-specific formatting only
runs when no special print_mode applies; update or add text referencing
inside_list, fmt_inside_list, fmt_auto_link_like, fmt_normalize_words,
fmt_trim_all and note the interaction with block_list.rs and fenced-code callers
to make the rationale explicit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c8829b0c-78ad-4787-9835-44c856fac141

📥 Commits

Reviewing files that changed from the base of the PR and between 75b1b62 and 86eb833.

⛔ Files ignored due to path filters (4)
  • crates/biome_markdown_formatter/tests/specs/markdown/list_continuation.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/markdown/ordered_lists.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/list/indent.md.snap is excluded by !**/*.snap and included by **
  • crates/biome_markdown_formatter/tests/specs/prettier/markdown/list/nested-checkbox.md.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (5)
  • .claude/skills/formatter-development/SKILL.md
  • crates/biome_markdown_formatter/src/markdown/lists/inline_item_list.rs
  • crates/biome_markdown_formatter/tests/quick_test.rs
  • crates/biome_markdown_formatter/tests/specs/markdown/list_continuation.md
  • crates/biome_markdown_formatter/tests/specs/markdown/ordered_lists.md

Comment on lines +163 to +166
```shell
just f # Format Rust code
just l # Lint
just gen-formatter # Regenerate formatter infrastructure if needed
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use the language-specific gen-formatter command here.

just gen-formatter nudges readers towards the wrong invocation; this doc should match the repo workflow and spell out the <lang> argument.

Suggested tweak
-just gen-formatter  # Regenerate formatter infrastructure if needed
+just gen-formatter <lang>  # Regenerate formatter infrastructure if needed

As per coding guidelines, Run 'just gen-formatter <lang>' before opening a PR when making changes to formatter implementations in *_formatter crates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/formatter-development/SKILL.md around lines 163 - 166, The
docs currently show a generic invocation "just gen-formatter" which is
incorrect; update the commands block and any references to use the
language-specific form "just gen-formatter <lang>" (e.g., replace the listed
`just gen-formatter` line and any guidance text) and add the explicit guidance
sentence "Run 'just gen-formatter <lang>' before opening a PR when making
changes to formatter implementations in *_formatter crates." to ensure the
README matches the repo workflow; look for the commands block containing `just
f`, `just l`, `just gen-formatter` and the surrounding paragraph in SKILL.md to
make this change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai did you verify your claim? I believe gen-formatter doesn't accept a lang argument

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

Let me check the actual justfile to verify this.


🏁 Script executed:

#!/bin/bash
grep -A 10 "gen-formatter" justfile 2>/dev/null || grep -A 10 "gen-formatter" Justfile 2>/dev/null

Length of output: 304


@ematipico, you're right — I should have verified before flagging. The justfile defines:

gen-formatter *args='':
  cargo run -p xtask_codegen -- formatter {{args}}

The *args='' makes the argument optional, so just gen-formatter (no lang) is perfectly valid. My suggestion was wrong, and the existing doc is correct as-is. I'll update the learning.

Sorry for the noise! 🐇


⛔ Learnings removed
Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to crates/*_formatter/src/**/*.rs : Run 'just gen-formatter <lang>' before opening a PR when making changes to formatter implementations in `*_formatter` crates.

🧠 Learnings used
Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to crates/*_formatter/src/**/*.rs : Run 'just gen-formatter <lang>' before opening a PR when making changes to formatter implementations in `*_formatter` crates.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Applies to **/*.{rs,toml} : Run `just f` (alias for `just format`) to format Rust and TOML files before committing and opening a PR

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-04-07T12:58:59.356Z
Learning: Run `just f` to format code and `just l` to lint code before submitting rule changes

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2026-02-05T16:31:32.222Z
Learning: Run `just gen-formatter` to automatically generate formatter boilerplate code in `crates/biome_<language>_formatter/src/` with module structure and default `FormatNodeRule<N>` implementations

Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to **/*.{rs,ts,tsx,js,jsx,json,md} : Always run 'just f' to format code and 'just l' to lint code before committing, ensuring all code follows project standards.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2026-02-05T16:31:32.222Z
Learning: Create formatter crate structure using `just new-crate biome_<language>_formatter` command

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Applies to **/*.rs : Run `just l` (alias for `just lint`) to lint the whole project before committing and opening a PR

Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to crates/*_analyze/src/**/*.rs : Run 'just gen-rules' and 'just gen-configuration' before opening a PR when making changes to lint rules in `*_analyze` crates.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Applies to packages/biomejs/** : When developing Node.js packages, build packages after implementing features/bug fixes so tests run against compiled files; follow the build steps: install tools, build backend-jsonrpc, build WASM, and link bindings

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Run `just gen-bindings` when working around the workspace to regenerate code

Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to **/*.ungram : Run 'just gen-grammar <lang>' before opening a PR when making changes to Grammar `.ungram` files to regenerate the parser and syntax.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2026-02-05T16:31:32.222Z
Learning: Applies to crates/biome_formatter/**/tests/spec_test.rs : In formatter test files, use `tests_macros::gen_tests!` macro to auto-generate test functions for spec files in `tests/specs/<language>/**/*` directory

Learnt from: tidefield
Repo: biomejs/biome PR: 9693
File: crates/biome_markdown_formatter/src/markdown/auxiliary/bullet.rs:24-24
Timestamp: 2026-04-02T09:34:17.898Z
Learning: In `crates/biome_markdown_formatter/` (and biome formatter crates generally), `format_verbatim_node` is only acceptable as initial scaffolding boilerplate when a formatter is first set up. Once active formatting features are being implemented, no new calls to `format_verbatim_node` should be introduced — new feature code must format the node's fields explicitly instead. Per ematipico: its use in feature code is considered a bug. Per tidefield: this applies to all new formatting feature work in biome_markdown_formatter.

Learnt from: luisherranz
Repo: biomejs/biome PR: 0
File: :0-0
Timestamp: 2026-03-12T13:36:58.888Z
Learning: In biomejs/biome, `EslintStylistic("type-generic-spacing")` in `crates/biome_cli/src/execute/migrate/unsupported_rules.rs` is NOT related to the `delimiterSpacing` formatter option. It controls spacing around generic type brackets differently and should not be mapped to `FormatterOption("delimiterSpacing")`.

Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Applies to .changeset/** : Write changeset descriptions concisely and clearly (1-3 sentences), using past tense for actions performed and present tense for Biome behavior; include examples with inline code snippets or code blocks for new rules, formatter changes, or parser changes

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Applies to crates/biome_formatter/**/*.rs : Follow technical guidelines and patterns documented in the biome_formatter CONTRIBUTING.md for formatter implementation and testing

Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to .changeset/*.md : Write changeset descriptions for end users, not developers. For bug fixes, start with 'Fixed [`#NUMBER`](issue link): ...'. For new features, describe what the feature does and why users care.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Applies to **/*.{rs,ts,tsx,js} : All code changes MUST include appropriate tests: lint rules require snapshot tests in 'tests/specs/{group}/{rule}/', formatters require snapshot tests with valid/invalid cases, parsers require test files covering valid and error cases, and bug fixes require tests that reproduce and validate the fix.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T19:15:52.743Z
Learning: Use concise, precise wording in PR summaries - don't overload reviewers with unnecessary information. Accept verbose summaries only for major refactors, architectural changes, complex features, or breaking changes.

Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2026-04-06T21:31:01.863Z
Learning: Applies to .changeset/** : For changeset descriptions of bug fixes, reference the issue with a link (e.g., 'Fixed [`#4444`](...)'); for rule references, include links to the rule documentation (e.g., '[useAwesomeThing](https://biomejs.dev/linter/rules/use-awesome-thing/)')

Learnt from: jfmcdowell
Repo: biomejs/biome PR: 0
File: :0-0
Timestamp: 2026-03-30T19:37:09.297Z
Learning: In `crates/biome_markdown_parser/src/syntax/fenced_code_block.rs`, there is an intentional asymmetry between opening and closing fence indent stripping inside list items:
- **Opening fence**: `check_continuation_indent` (called before the fenced code block parser runs) already consumes the list continuation indent, so the opener only needs to emit the remaining 0–3 CommonMark-allowed fence spaces (`MAX_BLOCK_PREFIX_INDENT`). Stripping `list_item_required_indent` in the opener is NOT needed.
- **Closing fence**: processes the raw line without prior consumption, so it must strip `list_item_required_indent + MAX_BLOCK_PREFIX_INDENT` itself (the fix introduced in PR `#9730`).

Learnt from: luisherranz
Repo: biomejs/biome PR: 9719
File: crates/biome_js_formatter/src/js/expressions/call_arguments.rs:0-0
Timestamp: 2026-04-10T15:40:45.681Z
Learning: In biomejs/biome PR `#9719`, the `delimiterSpacing` option for call arguments in `crates/biome_js_formatter/src/js/expressions/call_arguments.rs` intentionally emits spaces inside the parens whenever the opening/closing paren and its adjacent argument stay on the same line — even if the argument's inner content (e.g., a function body) is multiline. Spaces are only suppressed when the argument itself breaks to its own line (i.e., the paren and the argument are NOT on the same line). This applies uniformly to the special-case paths (test calls, React hooks, AMD/CJS, multiline-template-only). Do NOT flag unconditional `space()` calls in these paths as a bug for multiline cases.

Learnt from: tidefield
Repo: biomejs/biome PR: 9480
File: crates/biome_markdown_formatter/src/markdown/auxiliary/hard_line.rs:11-31
Timestamp: 2026-03-14T11:30:13.488Z
Learning: In `crates/biome_markdown_formatter/src/markdown/auxiliary/hard_line.rs`, `FormatMdHardLine::fmt_fields` is responsible for emitting `hard_line_break()` itself (not the caller). As of PR `#9480` (building on `#9331` by ematipico), the function branches on the token text: if it ends with `\` it emits `format_removed(&token)` + `text("\\", ...)` + `hard_line_break()`; otherwise it normalises to two trailing spaces via `format_removed(&token)` + `text("  ", ...)` + `hard_line_break()`. The callers in `inline_item_list.rs` and `paragraph.rs` do NOT add an extra `hard_line_break()`.

@ematipico ematipico merged commit 8bf50e2 into main Apr 16, 2026
30 checks passed
@ematipico ematipico deleted the feat/md-ordered-lists branch April 16, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Tooling Area: internal tools L-HTML Language: HTML and super languages L-Markdown Language: Markdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants