From 5fa18c0280a4f226d7f90130acf91da0aa474d38 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 21 Jan 2021 17:30:51 +0000 Subject: [PATCH] Linting. --- packages/string-templates/src/custom/preprocessor.js | 8 ++++++-- packages/string-templates/src/helpers/constants.js | 2 +- packages/string-templates/src/helpers/external.js | 10 ++++++---- packages/string-templates/src/helpers/index.js | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/string-templates/src/custom/preprocessor.js b/packages/string-templates/src/custom/preprocessor.js index 83f08cf9da..a86af5cd43 100644 --- a/packages/string-templates/src/custom/preprocessor.js +++ b/packages/string-templates/src/custom/preprocessor.js @@ -44,10 +44,14 @@ const PROCESSORS = [ // exclude helpers and brackets, regex will only find double brackets const exclusions = HelperNames() // find all the parts split by spaces - const splitBySpaces = statement.split(" ").filter(el => el !== "{{" && el !== "}}") + const splitBySpaces = statement + .split(" ") + .filter(el => el !== "{{" && el !== "}}") // remove braces if they are found and weren't spaced out splitBySpaces[0] = splitBySpaces[0].replace("{", "") - splitBySpaces[splitBySpaces.length - 1] = splitBySpaces[splitBySpaces.length - 1].replace("}", "") + splitBySpaces[splitBySpaces.length - 1] = splitBySpaces[ + splitBySpaces.length - 1 + ].replace("}", "") // remove the excluded elements const propertyParts = splitBySpaces.filter( part => exclusions.indexOf(part) === -1 diff --git a/packages/string-templates/src/helpers/constants.js b/packages/string-templates/src/helpers/constants.js index a2dccaea10..124ba6f277 100644 --- a/packages/string-templates/src/helpers/constants.js +++ b/packages/string-templates/src/helpers/constants.js @@ -12,7 +12,7 @@ module.exports.HelperFunctionBuiltin = [ "unless", "log", "lookup", - "with" + "with", ] module.exports.HelperFunctionNames = { diff --git a/packages/string-templates/src/helpers/external.js b/packages/string-templates/src/helpers/external.js index 840e40dbd7..9bad3a0eba 100644 --- a/packages/string-templates/src/helpers/external.js +++ b/packages/string-templates/src/helpers/external.js @@ -13,7 +13,7 @@ const EXTERNAL_FUNCTION_COLLECTIONS = [ "number", "url", "string", - "markdown" + "markdown", ] const DATE_NAME = "date" @@ -26,15 +26,17 @@ exports.registerAll = handlebars => { let hbsHelperInfo = helpers[collection]() for (let [name, func] of Object.entries(hbsHelperInfo)) { // skip built in functions and ones seen already - if (HelperFunctionBuiltin.indexOf(name) !== -1 || - externalNames.indexOf(name) !== -1) { + if ( + HelperFunctionBuiltin.indexOf(name) !== -1 || + externalNames.indexOf(name) !== -1 + ) { continue } externalNames.push(name) } // attach it to our handlebars instance helpers[collection]({ - handlebars + handlebars, }) } // add date external functionality diff --git a/packages/string-templates/src/helpers/index.js b/packages/string-templates/src/helpers/index.js index 0891d54c60..e5cf3c7a01 100644 --- a/packages/string-templates/src/helpers/index.js +++ b/packages/string-templates/src/helpers/index.js @@ -32,7 +32,7 @@ const HELPERS = [ module.exports.HelperNames = () => { return Object.values(HelperFunctionNames).concat( HelperFunctionBuiltin, - externalHandlebars.externalHelperNames, + externalHandlebars.externalHelperNames ) }