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 12:00:20 +01:00 committed by GitHub
parent a8577c21ba
commit 24bcf9b3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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',
});