From 71ef76e066b738996ce5c2b43a8683d83aac406f Mon Sep 17 00:00:00 2001 From: onderonur Date: Wed, 9 Oct 2024 23:10:22 +0300 Subject: [PATCH] prettier config improvement with @vercel/style-guide --- package-lock.json | 1 - package.json | 1 - prettier.config.js | 8 ++++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4acf23b..be47de2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "npm-check-updates": "^17.0.6", "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^4.0.0", - "prettier-plugin-packagejson": "^2.5.1", "prettier-plugin-tailwindcss": "^0.6.6", "turbo": "^2.0.14" }, diff --git a/package.json b/package.json index 8177469..3eff0d9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "npm-check-updates": "^17.0.6", "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^4.0.0", - "prettier-plugin-packagejson": "^2.5.1", "prettier-plugin-tailwindcss": "^0.6.6", "turbo": "^2.0.14" }, diff --git a/prettier.config.js b/prettier.config.js index 3a7a1a2..f48103f 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,15 +1,15 @@ +const styleguide = require('@vercel/style-guide/prettier'); + /** @type {import("prettier").Config} */ module.exports = { - singleQuote: true, - trailingComma: 'all', - endOfLine: 'lf', + ...styleguide, // To skip destructive code actions of `prettier-plugin-organize-imports`, // removing unused imports: // https://www.npmjs.com/package/prettier-plugin-organize-imports#skip-destructive-code-actions organizeImportsSkipDestructiveCodeActions: true, plugins: [ + ...styleguide.plugins, 'prettier-plugin-organize-imports', - 'prettier-plugin-packagejson', // Should be the last one. // https://github.com/tailwindlabs/prettier-plugin-tailwindcss?tab=readme-ov-file#compatibility-with-other-prettier-plugins 'prettier-plugin-tailwindcss',