Chore: Fix pseudo i18n generation script to work with Prettier 3 (#71734)

prettier.format is now a promise -> await it!
This commit is contained in:
Ashley Harrison
2023-07-17 14:00:20 +03:00
committed by GitHub
parent a8577c21ba
commit 24bcf9b3fd
+2 -2
View File
@@ -13,10 +13,10 @@ function pseudoizeJsonReplacer(key, value) {
return value;
}
fs.readFile('./public/locales/en-US/grafana.json').then((enJson) => {
fs.readFile('./public/locales/en-US/grafana.json').then(async (enJson) => {
const enMessages = JSON.parse(enJson);
// Add newline to make prettier happy
const pseudoJson = prettier.format(JSON.stringify(enMessages, pseudoizeJsonReplacer, 2), {
const pseudoJson = await prettier.format(JSON.stringify(enMessages, pseudoizeJsonReplacer, 2), {
parser: 'json',
});