base > docs > development > Using Prettier
Prettier is an opinionated code formatter that enforces a consistent code style across the entire project. This repository uses Prettier in two ways:
This repository includes a CI workflow that automatically checks for formatting issues on every pull request.
prettier --check .. If it finds any files that are not correctly formatted, the workflow will fail. This prevents code with incorrect formatting from being merged.For convenience, this repository also includes a manual formatting workflow that you can trigger from the Actions tab in GitHub.
prettier --write . on all files and commits any changes back to your branch.While the automated workflow handles formatting on the server, it’s a good practice to run Prettier locally as you work.
This repository includes Prettier as a development dependency in package.json. To install it, run:
npm install
The repository also includes a .prettierrc configuration file, so you don’t need to create one.
You can run Prettier from the command line to format your files.
npx prettier . --write
npx prettier . --check
For more detailed information on using Prettier, refer to the official Prettier documentation.