From 0c82236f10999a05d2688b8166a0031f683001e7 Mon Sep 17 00:00:00 2001 From: Mehul Kar Date: Thu, 1 Jun 2023 20:19:49 -0700 Subject: [PATCH] Run prettier in individual workspaces (vercel/turbo#3925) This adds a `lint:prettier` task in each workspace so that we can get the benefits of a granular cache and when running prettier, we don't have to run it across the entire monorepo (notably the `benchmark/` workspace which is very slow to run prettier on, and rarely changes -- an ideal candidate for a cache hit) --- packages/turbo-tracing-next-plugin/package.json | 3 ++- .../test/with-mongodb-mongoose/package.json | 3 ++- packages/webpack-nmt/package.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/turbo-tracing-next-plugin/package.json b/packages/turbo-tracing-next-plugin/package.json index e2f0662f52b40..4d250803e4902 100644 --- a/packages/turbo-tracing-next-plugin/package.json +++ b/packages/turbo-tracing-next-plugin/package.json @@ -20,6 +20,7 @@ "next": "^13.0.6" }, "scripts": { - "lint": "eslint src/**/*.ts" + "lint": "eslint src/**/*.ts", + "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore" } } diff --git a/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/package.json b/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/package.json index 0d37857c6965c..fa0a95a58eb2b 100644 --- a/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/package.json +++ b/packages/turbo-tracing-next-plugin/test/with-mongodb-mongoose/package.json @@ -4,7 +4,8 @@ "scripts": { "dev": "next dev", "build": "cross-env MONGODB_URI=localhost:27017 next build", - "start": "next start" + "start": "next start", + "lint:prettier": "prettier -c . --cache --ignore-path=../../../../.prettier-ignore" }, "dependencies": { "mongoose": "^6.4.5", diff --git a/packages/webpack-nmt/package.json b/packages/webpack-nmt/package.json index 03f4b911b6183..5216585978782 100644 --- a/packages/webpack-nmt/package.json +++ b/packages/webpack-nmt/package.json @@ -21,6 +21,7 @@ "webpack": "^5.75.0" }, "scripts": { - "lint": "eslint src/**/*.ts" + "lint": "eslint src/**/*.ts", + "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore" } }