https://github.com/macklinu/best-prettier-config
The best prettier config in the world :earth_americas:
https://github.com/macklinu/best-prettier-config
prettier
Last synced: 2 months ago
JSON representation
The best prettier config in the world :earth_americas:
- Host: GitHub
- URL: https://github.com/macklinu/best-prettier-config
- Owner: macklinu
- License: mit
- Created: 2018-10-04T01:29:38.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-10-16T18:14:55.000Z (over 2 years ago)
- Last Synced: 2025-10-26T06:31:21.718Z (8 months ago)
- Topics: prettier
- Language: TypeScript
- Homepage:
- Size: 71.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# best-prettier-config
> The best [prettier][] config in the world :earth_americas:
I add this file to all my projects, so I made a CLI to make it easier to do so.
```sh
npx best-prettier-config
```
> **Note:** As of v2, I use Bun to execute one-off scripts, but `bunx best-prettier-config@latest` isn't always working. I will ultimately move to that once Bun becomes more stable, but `npx best-prettier-config@latest` still works.
This will write a `.prettierrc` file with the following contents to your current working directory:
```json
{
"jsxSingleQuote": true,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
```
If you need to add a couple plugins, like working on an Astro project with Tailwind, you can use the `--plugin` command line argument:
```sh
# These are all the same
npx best-prettier-config --plugin prettier-plugin-astro --plugin prettier-plugin-tailwind
npx best-prettier-config --plugin astro --plugin tailwind
npx best-prettier-config -p astro -p tailwind
```
Example output:
```json
{
"jsxSingleQuote": true,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwind"]
}
```
[prettier]: https://github.com/prettier/prettier