Taplo is a TOML validator and formatter. It provides a command-line interface (CLI) for working with TOML files.
You can install Taplo using either cargo or Yarn or NPM.
cargo install taplo-cli --locked
yarn global add @taplo/cli
npm install -g @taplo/cli
To check your TOML files for formatting issues, use the following command:
npx @taplo/cli fmt --config taplo.toml --check
To format all TOML files in your project, use the following command:
npx @taplo/cli fmt --config taplo.toml
This command will automatically format the TOML files, ensuring consistent and readable formatting.
Taplo allows you to customize the formatting rules by adding configuration options. You can find the available options and how to use them here.