From 5f3a219e14c27bb2e3a305f8c9170aaca3220be1 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Sat, 26 May 2018 19:36:41 +0200 Subject: Fixed Prettier Config Applying + Updated Prettier to newest version --- scripts/frontend/prettier.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/scripts/frontend/prettier.js b/scripts/frontend/prettier.js index 39de77bc333..4979ec3c409 100644 --- a/scripts/frontend/prettier.js +++ b/scripts/frontend/prettier.js @@ -73,12 +73,12 @@ if (!files.length) { console.log(`${shouldSave ? 'Updating' : 'Checking'} ${files.length} file(s)`); -prettier - .resolveConfig('.') - .then(options => { - console.log('Found options : ', options); - files.forEach(file => { - try { + +files.forEach(file => { + try { + prettier + .resolveConfig(file) + .then(options => { const fileExtension = file.split('.').pop(); Object.assign(options, { parser: config.parsers[fileExtension], @@ -101,17 +101,17 @@ prettier } console.log(`Prettify Manually : ${file}`); } - } catch (error) { - didError = true; - console.log(`\n\nError with ${file}: ${error.message}`); - } - }); - - if (didWarn || didError) { - process.exit(1); - } - }) - .catch(e => { - console.log(`Error on loading the Config File: ${e.message}`); - process.exit(1); - }); + }) + .catch(e => { + console.log(`Error on loading the Config File: ${e.message}`); + process.exit(1); + }); + } catch (error) { + didError = true; + console.log(`\n\nError with ${file}: ${error.message}`); + } +}); + +if (didWarn || didError) { + process.exit(1); +} -- cgit v1.2.1