YAML: Preserve order of anchor and tag (#19599)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-07-19 10:20:39 +08:00
1 parent b35943fa92
commit 351e399362
4 files changed
+51 -30

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
#### Preserve order of anchor and tag (#19599 by @fisker)
<!-- prettier-ignore -->
```yaml
# Input
foo: &anchor1 !!str Value1
bar: !!str &anchor2 Value2
# Prettier stable
foo: !!str &anchor1 Value1
bar: !!str &anchor2 Value2
# Prettier main
foo: &anchor1 !!str Value1
bar: !!str &anchor2 Value2
```