From 08a2985a4cde546283956457c9a87f1237d7e380 Mon Sep 17 00:00:00 2001 From: Derek Croote Date: Wed, 22 Feb 2023 07:29:28 -0800 Subject: [PATCH] fix: apply prettier programmatically in update script (#1656) --- .changeset/dirty-feet-try.md | 2 ++ scripts/update-config-fixtures.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changeset/dirty-feet-try.md diff --git a/.changeset/dirty-feet-try.md b/.changeset/dirty-feet-try.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/dirty-feet-try.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/scripts/update-config-fixtures.ts b/scripts/update-config-fixtures.ts index 3dcbd20a32..a8ed97a735 100644 --- a/scripts/update-config-fixtures.ts +++ b/scripts/update-config-fixtures.ts @@ -1,5 +1,6 @@ import { readFileSync, writeFileSync } from 'fs'; import fg from 'fast-glob'; +import { format } from 'prettier'; import { version as packageVersion } from '../packages/airnode-node/package.json'; const configPatterns = ['./packages/**/*config.example.json', './packages/**/*config.valid.json']; @@ -13,7 +14,7 @@ configPatterns.forEach((pattern) => { // eslint-disable-next-line no-console console.log(`Updating "${f}" to version ${packageVersion}`); - writeFileSync(f, JSON.stringify(config, null, 2) + '\n'); + writeFileSync(f, format(JSON.stringify(config, null, 2), { parser: 'json', printWidth: 120 })); }); });