From e804a61c935a85fefe18e8529692ad4c15b467c3 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Mon, 9 Oct 2023 10:19:16 -0700 Subject: [PATCH] Upgrade to prettier 3.0 (#24) --- package-lock.json | 18 +++++++++--------- package.json | 6 +++--- src/progress-reporter.ts | 5 ++++- src/worker.ts | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index c759bdd..616e210 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "glob-stream": "^7.0.0", "ignore": "^5.1.8", "ora": "^5.3.0", - "prettier": "^2.0.4", + "prettier": "^3.0.3", "rxjs": "^6.6.3" }, "bin": { @@ -1719,14 +1719,14 @@ } }, "node_modules/prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -3524,9 +3524,9 @@ "dev": true }, "prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==" }, "process-nextick-args": { "version": "2.0.1", diff --git a/package.json b/package.json index 6929823..cdf0c81 100644 --- a/package.json +++ b/package.json @@ -37,16 +37,16 @@ "glob-stream": "^7.0.0", "ignore": "^5.1.8", "ora": "^5.3.0", - "prettier": "^2.0.4", + "prettier": "^3.0.3", "rxjs": "^6.6.3" }, "peerDependencies": { - "prettier": "^2.0.0" + "prettier": "^3.0.0" }, "devDependencies": { "@types/glob-stream": "^6.1.0", "@types/node": "^14.14.22", - "@types/prettier": "^2.1.6", + "@types/prettier": "^3.0.0", "@typescript-eslint/eslint-plugin": "^4.14.0", "@typescript-eslint/parser": "^4.14.0", "eslint": "^7.18.0", diff --git a/src/progress-reporter.ts b/src/progress-reporter.ts index c4053d7..81e33d0 100644 --- a/src/progress-reporter.ts +++ b/src/progress-reporter.ts @@ -15,7 +15,10 @@ export class ProgressReporter { public failed = 0; private spinner?: ora.Ora; - constructor(quiet: boolean, private readonly check: boolean) { + constructor( + quiet: boolean, + private readonly check: boolean, + ) { if (!quiet) { this.spinner = ora('Starting...').start(); } diff --git a/src/worker.ts b/src/worker.ts index 2adf20a..80788ed 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -39,7 +39,7 @@ function runFormatting( const contents = await fs.readFile(file.path, 'utf-8'); let formatted: string; try { - formatted = prettier.format(contents, { + formatted = await prettier.format(contents, { ...(await prettier.resolveConfig(file.path)), filepath: file.path, });