prettier Command Examples

An opinionated code formatter for JavaScript, JSON, CSS, YAML, and more. More information: https://prettier.io/.

prettier {{path/to/file}}

prettier --check {{path/to/file}}

prettier --config {{path/to/config_file}} {{path/to/file}}

prettier --write {{path/to/file_or_directory}}

prettier --single-quote --trailing-comma {{none}} --write {{path/to/file_or_directory}}

prettier --write "**/*.{js,jsx,ts,tsx}"