Prettier hooks
Last updated
Was this helpful?
Last updated
Was this helpful?
Using with Prettier is a good way to provide automated linting to your YAML files. With , you also get the benefit of only linting/fixing the files that changed.
This makes the formatting process more efficient and ensures consistent YAML styling across your project without unnecessarily processing unmodified files.
prettier
Arguments
--write
: Write changes directly to files
--check
: Check if files are formatted without modifying them
--tab-width
: Number of spaces per indentation level
--use-tabs
: Use tabs instead of spaces for indentation
--prose-wrap
: Control wrapping of prose (preserve, always, never)
Example
To point pre-commit to use your custom .prettierrc
rules file, you need to put the .prettierrc
file in your repository root.
See also: