diff --git a/packages/string-templates/rollup.config.js b/packages/string-templates/rollup.config.js index 6ca34c5dfe..5a71316fb5 100644 --- a/packages/string-templates/rollup.config.js +++ b/packages/string-templates/rollup.config.js @@ -4,8 +4,6 @@ import builtins from "rollup-plugin-node-builtins" import globals from "rollup-plugin-node-globals" import json from "@rollup/plugin-json" -const production = !process.env.ROLLUP_WATCH - export default { input: "src/index.js", output: [ diff --git a/packages/string-templates/src/helpers/external.js b/packages/string-templates/src/helpers/external.js index 9bad3a0eba..7c767db5f4 100644 --- a/packages/string-templates/src/helpers/external.js +++ b/packages/string-templates/src/helpers/external.js @@ -24,7 +24,8 @@ exports.registerAll = handlebars => { for (let collection of EXTERNAL_FUNCTION_COLLECTIONS) { // collect information about helper let hbsHelperInfo = helpers[collection]() - for (let [name, func] of Object.entries(hbsHelperInfo)) { + for (let entry of Object.entries(hbsHelperInfo)) { + const name = entry[0] // skip built in functions and ones seen already if ( HelperFunctionBuiltin.indexOf(name) !== -1 || diff --git a/packages/string-templates/src/processors/postprocessor.js b/packages/string-templates/src/processors/postprocessor.js index 76a962c52f..9f2491cb17 100644 --- a/packages/string-templates/src/processors/postprocessor.js +++ b/packages/string-templates/src/processors/postprocessor.js @@ -1,5 +1,4 @@ -const { FIND_HBS_REGEX } = require("../utilities") - +/* eslint-disable no-unused-vars */ class Postprocessor { constructor(name, fn) { this.name = name diff --git a/packages/string-templates/src/processors/preprocessor.js b/packages/string-templates/src/processors/preprocessor.js index aa1d58bd43..131fb522f9 100644 --- a/packages/string-templates/src/processors/preprocessor.js +++ b/packages/string-templates/src/processors/preprocessor.js @@ -1,5 +1,5 @@ const { HelperNames } = require("../helpers") -const { swapStrings, isAlphaNumeric, FIND_HBS_REGEX } = require("../utilities") +const { swapStrings, isAlphaNumeric } = require("../utilities") const PreprocessorNames = { SWAP_TO_DOT: "swap-to-dot-notation", @@ -7,6 +7,7 @@ const PreprocessorNames = { FINALISE: "finalise", } +/* eslint-disable no-unused-vars */ class Preprocessor { constructor(name, fn) { this.name = name diff --git a/packages/string-templates/src/utilities.js b/packages/string-templates/src/utilities.js index e700ea6c53..71b5aa1875 100644 --- a/packages/string-templates/src/utilities.js +++ b/packages/string-templates/src/utilities.js @@ -14,12 +14,10 @@ module.exports.swapStrings = (string, start, length, swap) => { module.exports.removeNull = obj => { return Object.fromEntries( Object.entries(obj) - .filter(([key, value]) => value != null) + .filter(entry => entry[1] != null) .map(([key, value]) => [ key, value === Object(value) ? module.exports.removeNull(value) : value, ]) ) } - -module.exports.findHbsStatements = string => {}