diff --git a/@types/lib/util/file.d.ts.map b/@types/lib/util/file.d.ts.map index 0903eeb12..bf37128b2 100644 --- a/@types/lib/util/file.d.ts.map +++ b/@types/lib/util/file.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../lib/util/file.js"],"names":[],"mappings":";yBAWa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;AA4jB1D;;;IA1iBI;;;;;;OAMG;yBAHQ,MAAM,MACN,MAAM,GACJ,OAAO,CAAE;QAAC,MAAM,EAAC,IAAI,GAAC,SAAS,GAAC,QAAQ,CAAC;QAAC,aAAa,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC;IAkB1F;;;;;OAKG;iCAFQ,MAAM,GACJ,MAAM;IAiCnB;;;;;OAKG;qCAFQ,MAAM,GACJ,MAAM;IA2BnB;;;;;OAKG;4CAFQ,MAAM,GACJ,MAAM;IAMnB;;;;;OAKG;sCAFQ,MAAM,GAAC,MAAM,EAAE,KACb,MAAM;IAcnB;;;;;;;OAOG;iCAJQ,MAAM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OAMG;4CAHQ,MAAM,eACN,OAAO,KACL,OAAO,CAAE,MAAM,CAAC;IAW7B;;;;;;OAMG;kCAHQ,MAAM,eACN,OAAO,KACL,OAAO,CAAE,MAAM,CAAC;IAyB7B;;;;;;;;;OASG;oCALQ,MAAM,GAAC,MAAM,EAAE,YACf,MAAM,YACN,MAAM,WACN,MAAM,KACJ,OAAO,CAAE,MAAM,CAAC;IA8F7B;;;;;;;;;OASG;6BANQ,MAAM,GAAC,MAAM,EAAE,YACf,MAAM,YACN,MAAM,WACN,MAAM,aACN,MAAM,KACJ,OAAO,CAAE,OAAO,CAAC;IAoB9B;;;;;;;OAOG;8BAJQ,MAAM,GAAG,MAAM,EAAE,YACjB,MAAM,aACN,OAAO,KACL,OAAO,CAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IA0B7C;;;;;;;;OAQG;sCALQ,MAAM,GAAG,MAAM,EAAE,YACjB,MAAM,YACN,MAAM,aACN,MAAM,KACJ,OAAO,CAAE,MAAM,CAAC;IAc7B;;;;;;;;;;OAUG;iCALQ,MAAM,SACN,MAAM,gBACN,OAAO,gBACP,MAAM,KACJ,OAAO,CAAE,MAAM,EAAE,CAAC;IA6C/B;;;;;;;;;;;OAWG;qCALQ,MAAM,UACN,MAAM,gBACN,OAAO,gBACP,MAAM,KACJ,MAAM,EAAE,GAAG,IAAI;IA4C5B;;;;;OAKG;+BAFQ,OAAO,GACL,OAAO,CAAE,IAAI,CAAC;IAU3B;;;;;OAKG;4BAFQ,MAAM,GACJ,OAAO,CAAE,OAAO,CAAC;EAgCK;eAzlBxB,UAAU"} \ No newline at end of file diff --git a/boilerplate/config.json b/boilerplate/config.json index eb691e06c..92669362c 100644 --- a/boilerplate/config.json +++ b/boilerplate/config.json @@ -7,6 +7,7 @@ }, "options": { "formatOnSave": true, + "formatErrorLog": false, "deployment": { "commitHistory": 10, "sourceTargetMapping": { diff --git a/lib/util/file.js b/lib/util/file.js index 6ceea7fbe..1c9ad3960 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -270,6 +270,7 @@ const File = { * @returns {Promise.} original string on error; formatted string on success */ _beautify_prettier: async function (directory, filename, filetype, content) { + const properties = await config.getProperties(); let formatted = ''; try { if (!FileFs.prettierConfig) { @@ -337,20 +338,22 @@ const File = { formatted = await prettier.format(content, FileFs.prettierConfig); } catch (ex) { - // save prettier errror into log file - // Note: we have to filter color codes from prettier's error message before saving it to file - /* eslint-disable no-control-regex */ - this.writeToFile( - directory, - filename + '.error', - 'log', - `Error Log\nParser: ${FileFs.prettierConfig.parser}\n${ex.message.replaceAll( - /[\u001B\u009B][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, - - '' - )}` - ); - /* eslint-enable no-control-regex */ + if (properties.options.formatErrorLog) { + // save prettier errror into log file + // Note: we have to filter color codes from prettier's error message before saving it to file + /* eslint-disable no-control-regex */ + this.writeToFile( + directory, + filename + '.error', + 'log', + `Error Log\nParser: ${FileFs.prettierConfig.parser}\n${ex.message.replaceAll( + /[\u001B\u009B][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, + + '' + )}` + ); + /* eslint-enable no-control-regex */ + } formatted = content; } diff --git a/test/mockRoot/.mcdevrc.json b/test/mockRoot/.mcdevrc.json index fe9e4653f..10d2bb21f 100644 --- a/test/mockRoot/.mcdevrc.json +++ b/test/mockRoot/.mcdevrc.json @@ -10,6 +10,7 @@ }, "options": { "formatOnSave": true, + "formatErrorLog": false, "deployment": { "commitHistory": 10, "sourceTargetMapping": {