YAML relies on indentation, so one misplaced space can change the meaning of a file. The formatter normalizes indentation and quoting with Prettier and validates the document, pointing to the exact line and column when it cannot be parsed.
Common uses
- Tidying a snippet before pasting it into a pull request or ticket
- Shrinking CSS or JavaScript for a quick size check
- Making a one-line SQL query from a log readable
Frequently asked questions
- Should I use tabs or spaces in YAML?
- Spaces only. Tabs are not allowed for indentation in YAML.
- Are comments kept?
- Yes, formatting preserves comments.