Custom Prettier configuration for JavaScript and TypeScript projects.
Additional configurations are available for:
- Prisma projects:
@jpapini/prettier-config/prisma
- Tailwind CSS projects:
@jpapini/prettier-config/tailwind
- Install the package and its required peer dependencies:
pnpm add -D @jpapini/prettier-config prettier
- Edit your
package.json
file to include the following:
{
"scripts": {
"lint:prettier": "prettier --cache --cache-location node_modules/.cache/prettier/.prettiercache --check -u '**/*'",
"format:prettier": "prettier --cache --cache-location node_modules/.cache/prettier/.prettiercache --write -u '**/*'"
},
"prettier": "@jpapini/prettier-config"
}
- Add a
.prettierignore
file with the following content:
### Jetbrains IDEs ###
.idea
### Visual Studio Code ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
### Dependencies ###
node_modules
.pnpm-store
pnpm-lock.yaml
### Template files ###
*.hbs
### Cache ###
.turbo
### Compiled outputs ###
dist
generated
### Tests ###
coverage
### Temporary ###
old
*.timestamp-*
- Julien Papini julien.papini@gmail.com