Skip to main content

The available flags in Prettier are as follows:

  • --write or -w: Formats the specified files in place, overwriting the original file contents with the formatted code.
  • --list-different or -l: Lists the files that are not formatted correctly according to Prettier's rules, without modifying the files.
  • --check or -c: Checks if the specified files are formatted correctly and returns a non-zero exit code if any files need formatting.
  • --ignore-path: Specifies the path to a file containing patterns of files and directories to ignore during formatting.
  • --config or --config-path: Specifies the path to the configuration file to use.
  • --help or -h: Displays the help information for Prettier and its available options.