View all files | ||||
This repository provides Biome hooks for pre-commit.
The following section assumes that you installed pre-commit and run pre-commit install in your repository.
Biome provides four hooks:
| biome-ci | Check formatting, check if imports are organized, and lints |
| biome-check | Format, organize imports, lint, and apply safe fixes to the committed files |
| biome-format | Format the committed files |
| biome-lint | Lint and apply safe fixes to the committed files |
For example, if you want to use the biome-check hook, add the following pre-commit configuration to the root of your project in a file named .pre-commit-config.yaml:
If Biome is already installed as a npm package in your local repository, then it can be a burden to update both package.json and .pre-commit-config.yaml when you update Biome. Instead of using the provided Biome hooks, you can specify your own local hook.
For example, if you use npm, you can write the following hook in .pre-commit-config.yaml:
The pre-commit option files is optional, because Biome is able to ignore unknown files (using the option --files-ignore-unknown=true).