logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Format Code with Prettier - JavaScript, CSS, YAML | Online Free DevTools by Hexmos

Format code instantly with Prettier. Enhance code quality and maintain consistency across JavaScript, CSS, and YAML files. Free online tool, no registration required.

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 {{path/to/file}}

  • Check if a specific file has been formatted:

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

  • Run with a specific configuration file:

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

  • Format a file or directory, replacing the original:

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

  • Format files or directories recursively using single quotes and no trailing commas:

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

  • Format JavaScript and TypeScript files recursively, replacing the original:

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

See Also