[GH-ISSUE #1523] if .markdownlint.yaml is empty, markdown lint crashes with Error: Unable to parse '.markdownlint.yaml'; Parser 0: Unable to parse JSONC content, ValueExpected (offset 0, length 0) #2550

Closed
opened 2026-03-07 20:08:48 +03:00 by kerem · 2 comments
Owner

Originally created by @onerandomusername on GitHub (Feb 27, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1523

Originally created by @onerandomusername on GitHub (Feb 27, 2025). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1523
kerem 2026-03-07 20:08:48 +03:00
Author
Owner

@DavidAnson commented on GitHub (Feb 28, 2025):

This is really interesting, thanks! When https://github.com/nodeca/js-yaml successfully parses an empty file (or one with only comments), it returns null. It's documented to do that and I see now that YAML documents could return a string or a number instead of an object - which I had not expected. I'll fix this soon, though it'll be a little bit before the fix makes it to a VS Code extension release.

<!-- gh-comment-id:2689591724 --> @DavidAnson commented on GitHub (Feb 28, 2025): This is really interesting, thanks! When <https://github.com/nodeca/js-yaml> successfully parses an empty file (or one with only comments), it returns `null`. It's documented to do that and I see now that YAML documents could return a string or a number instead of an object - which I had not expected. I'll fix this soon, though it'll be a little bit before the fix makes it to a VS Code extension release.
Author
Owner

@onerandomusername commented on GitHub (May 18, 2025):

Thank you so much!

<!-- gh-comment-id:2888748977 --> @onerandomusername commented on GitHub (May 18, 2025): Thank you so much!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2550
No description provided.