Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
docs: add package.json tip to improve a prettier setup
Browse files Browse the repository at this point in the history
Seen a lot of people get this wrong, so let's add a tip explaining
the benefits of setting the prettier configuration in `package.json`
rather than `.prettierrc` or `prettier.json`.
  • Loading branch information
filiphsps committed Oct 21, 2023
1 parent 711e49e commit 1aba98d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/content/tips/prettier-config-in-package-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
kind: package-json
title: Set package-level Prettier configuration
description: Keep the project's root folder clean while enforcing organization-wide codestyle.
contributor: https://github.com/filiphsps
snippet: |
{
"prettier": "@nordcom/prettier",
"scripts": {
"@nordcom/prettier": "0.1.1"
}
}
---

By setting the Prettier configuration directly in `package.json`, you avoid both the issue of saturating your workspace's root folder with another config file as well as arguably more importantly also completely eliminating inconsistencies in Prettier rules between projects.

0 comments on commit 1aba98d

Please sign in to comment.