prettier
An opinionated code formatter for JavaScript, JSON, CSS, YAML, and more. More information: https://prettier.io/docs/cli.
- Format a file and print the result to
stdout:
prettier
- Check if a specific file has been formatted:
prettier --check
- Run with a specific configuration file:
prettier --config
- Format a file or directory, replacing the original:
prettier --write
- Format files or directories recursively using single quotes and no trailing commas:
prettier --single-quote --trailing-comma --write
- Format JavaScript and TypeScript files recursively, replacing the original:
prettier --write "**/*.{js,jsx,ts,tsx}"
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
