|
| 1 | +# prettier-plugin-toml   |
| 2 | + |
| 3 | +> An opinionated `toml` formatter plugin for [Prettier][] |
| 4 | +
|
| 5 | +Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing, taking various rules into account. |
| 6 | + |
| 7 | +This plugin adds support for `toml` through [taplo][]. |
| 8 | + |
| 9 | +## Notice |
| 10 | + |
| 11 | +This plugin is still under development, its printer just wraps [taplo][]'s default printer. |
| 12 | +Of course it should just work, but may not match [prettier][]'s format sometimes. |
| 13 | + |
| 14 | +## Requirements |
| 15 | + |
| 16 | +`prettier-plugin-toml` is an evergreen module. 🌲 This module requires an [LTS](https://github.com/nodejs/Release) Node version (v16.0.0+). |
| 17 | + |
| 18 | +## Install |
| 19 | + |
| 20 | +Using npm: |
| 21 | + |
| 22 | +```sh |
| 23 | +# npm |
| 24 | +npm i -D prettier prettier-plugin-toml |
| 25 | + |
| 26 | +# yarn |
| 27 | +yarn add -D prettier prettier-plugin-toml |
| 28 | +``` |
| 29 | + |
| 30 | +## Usage |
| 31 | + |
| 32 | +Once installed, [Prettier plugins](https://prettier.io/docs/en/plugins.html) must be added to `.prettierrc`: |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "plugins": ["prettier-plugin-toml"] |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | +Then: |
| 41 | + |
| 42 | +```sh |
| 43 | +# npx |
| 44 | +npx prettier --write foo.toml |
| 45 | + |
| 46 | +# yarn |
| 47 | +yarn prettier --write foo.toml |
| 48 | +``` |
| 49 | + |
| 50 | +## Sponsors |
| 51 | + |
| 52 | +| 1stG | RxTS | UnTS | |
| 53 | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | |
| 54 | +| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) | |
| 55 | + |
| 56 | +## Backers |
| 57 | + |
| 58 | +[](https://github.com/sponsors/JounQin) |
| 59 | + |
| 60 | +| 1stG | RxTS | UnTS | |
| 61 | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | |
| 62 | +| [](https://opencollective.com/1stG) | [](https://opencollective.com/rxts) | [](https://opencollective.com/unts) | |
| 63 | + |
| 64 | +## Changelog |
| 65 | + |
| 66 | +Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md). |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +[MIT][] © [Ray][]@[mk1.io][] |
| 71 | + |
| 72 | +[mk1.io]: https://mk1.io |
| 73 | +[mit]: http://opensource.org/licenses/MIT |
| 74 | +[prettier]: https://prettier.io |
| 75 | +[ray]: https://GitHub.com/so1ve |
| 76 | +[taplo]: https://github.com/tamasfe/taplo |
0 commit comments