From 42a59ed8eb3a665b77afb7db9cb204c0cecf0257 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:50:44 -0700 Subject: [PATCH] Update devDependency prettier to v3 (#496) --- .prettierrc | 1 + .../change-d439055d-26fa-41d3-8196-829aba64863c.json | 11 +++++++++++ package.json | 2 +- .../src/__tests__/getCacheStorageProvider.test.ts | 5 ++++- packages/hasher/src/hashOfPackage.ts | 7 +++---- packages/hasher/src/repoInfo.ts | 11 +++++++---- tools/update-project-references.js | 2 +- yarn.lock | 8 ++++---- 8 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 change/change-d439055d-26fa-41d3-8196-829aba64863c.json diff --git a/.prettierrc b/.prettierrc index 1357a2f..aa6f07a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "endOfLine": "auto", + "trailingComma": "es5", "overrides": [ { "files": "*.md", diff --git a/change/change-d439055d-26fa-41d3-8196-829aba64863c.json b/change/change-d439055d-26fa-41d3-8196-829aba64863c.json new file mode 100644 index 0000000..c006165 --- /dev/null +++ b/change/change-d439055d-26fa-41d3-8196-829aba64863c.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "type": "none", + "comment": "Update formatting", + "packageName": "backfill-hasher", + "email": "elcraig@microsoft.com", + "dependentChangeType": "none" + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 80d9ce0..c8c4e66 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "lerna": "^7.0.0", "lint-staged": "^12.5.0", "lodash.merge": "^4.6.2", - "prettier": "~2.8.4", + "prettier": "~3.0.0", "prettier-package-json": "^2.8.0", "resolve-from": "^5.0.0", "syncpack": "8.4.11", diff --git a/packages/cache/src/__tests__/getCacheStorageProvider.test.ts b/packages/cache/src/__tests__/getCacheStorageProvider.test.ts index 41d6771..3d47579 100644 --- a/packages/cache/src/__tests__/getCacheStorageProvider.test.ts +++ b/packages/cache/src/__tests__/getCacheStorageProvider.test.ts @@ -83,7 +83,10 @@ describe("getCacheStorageProvider", () => { test("can get a custom storage provider as a class", () => { const TestProvider = class implements ICacheStorage { - constructor(private logger: Logger, private cwd: string) {} + constructor( + private logger: Logger, + private cwd: string + ) {} fetch(hash: string) { this.logger.silly(`fetching ${this.cwd} ${hash}`); diff --git a/packages/hasher/src/hashOfPackage.ts b/packages/hasher/src/hashOfPackage.ts index c99e61a..0965097 100644 --- a/packages/hasher/src/hashOfPackage.ts +++ b/packages/hasher/src/hashOfPackage.ts @@ -47,10 +47,9 @@ export async function getPackageHash( return memoization[memoizationKey]; } - const { name, dependencies, devDependencies } = require(path.join( - packageRoot, - "package.json" - )); + const { name, dependencies, devDependencies } = require( + path.join(packageRoot, "package.json") + ); const allDependencies: Dependencies = { ...dependencies, diff --git a/packages/hasher/src/repoInfo.ts b/packages/hasher/src/repoInfo.ts index fa3e204..8b960a1 100644 --- a/packages/hasher/src/repoInfo.ts +++ b/packages/hasher/src/repoInfo.ts @@ -44,10 +44,13 @@ export async function getRepoInfoNoCache(cwd: string) { // Sorting repoHash by key because we want to consistent hashing based on the order of the files const repoHashes = Object.keys(unorderedRepoHashes) .sort((a, b) => a.localeCompare(b)) - .reduce((obj, key) => { - obj[key] = unorderedRepoHashes[key]; - return obj; - }, {} as Record); + .reduce( + (obj, key) => { + obj[key] = unorderedRepoHashes[key]; + return obj; + }, + {} as Record + ); const workspaceInfo = getWorkspaces(root); const parsedLock = await parseLockFile(root); diff --git a/tools/update-project-references.js b/tools/update-project-references.js index b983479..b0b6e67 100644 --- a/tools/update-project-references.js +++ b/tools/update-project-references.js @@ -83,7 +83,7 @@ async function updateTSConfig({ filePath, content }, mergeConfig) { fs.writeFileSync( filePath, - prettier.format(newContent, { + await prettier.format(newContent, { ...prettierOptions, parser: "json", }) diff --git a/yarn.lock b/yarn.lock index ad089e7..2512b28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5665,10 +5665,10 @@ prettier-package-json@^2.8.0: sort-object-keys "^1.1.3" sort-order "^1.0.1" -prettier@~2.8.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@~3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== pretty-format@^29.0.0, pretty-format@^29.6.3: version "29.6.3"