Skip to content

Commit 9a423c5

Browse files
committed
docs: address review feedback on YAML RFC
Update parser table, add rules, and expand anchor handling design based on review comments from @lumirlumir and @DMartens.
1 parent 3c6031b commit 9a423c5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • designs/2026-official-yaml-language-plugin

designs/2026-official-yaml-language-plugin/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ The RFC does not prescribe a specific parser. Candidates include:
108108
| Parser | YAML version | Comments | Location info | Notes |
109109
|---|---|---|---|---|
110110
| [yaml (eemeli/yaml)](https://github.com/eemeli/yaml) | 1.1 + 1.2 | Yes (CST) | Yes | Mature, actively maintained, CST → AST |
111-
| [yaml-ast-parser](https://github.com/mulesoft-labs/yaml-ast-parser) | 1.2 | No | Yes | Fork of js-yaml with AST |
112-
| Approach from eslint-plugin-yml | 1.2 | Yes | Yes | Uses yaml-eslint-parser |
111+
| [yaml-eslint-parser](https://github.com/ota-meshi/yaml-eslint-parser) | 1.2 | Yes | Yes | ESTree-compatible AST on top of eemeli/yaml; used by eslint-plugin-yml |
113112

114113
The parser must:
115114
1. Produce a traversable AST with location info for every node.
@@ -149,6 +148,8 @@ Following the direction of the project — which is [moving away from formatting
149148
|---|---|---|
150149
| `no-duplicate-keys` | Disallow duplicate keys in mappings | No |
151150
| `no-empty-keys` | Disallow empty string keys | No |
151+
| `no-empty-values` | Disallow empty mapping values | No |
152+
| `no-empty-sequence-entry` | Disallow empty sequence entries | No |
152153
| `no-unsafe-values` | Disallow unquoted values that would be interpreted differently between YAML 1.1 and 1.2 (e.g. `yes`, `no`, `on`, `off` are booleans in 1.1 but plain strings in 1.2) | No |
153154

154155
**Additional (not in recommended, opt-in):**
@@ -235,7 +236,7 @@ export default defineConfig([
235236
2. **Parser choice:** Which YAML parser best balances maintainability, comment support, location accuracy, and license compatibility? (See parser comparison table above.)
236237
3. **Initial rule set:** Are the proposed rules the right starting point? Should any be added or removed for v1?
237238
4. **Collaboration model:** Should the team formally invite @ota-meshi or other community maintainers as collaborators on the new repo?
238-
5. **Anchor / alias handling:** How deeply should v1 resolve anchors and aliases in the AST? Full resolution enables more rules but adds complexity.
239+
5. **Anchor / alias handling:** How deeply should v1 resolve anchors and aliases in the AST? Full resolution enables more rules but adds complexity. One approach is a `sourceCode.resolveAnchor(aliasNode)` method that keeps resolution opt-in for rule authors without complicating the AST.
239240

240241
## Help Needed
241242

0 commit comments

Comments
 (0)