From 38f64aa7046b928d9926a26c56e6004f305d0a60 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 22 Feb 2024 00:39:27 +0100 Subject: [PATCH] Lint --- packages/string-templates/src/helpers/index.ts | 1 + packages/string-templates/src/index.ts | 8 +++++--- packages/string-templates/test/vm.spec.ts | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/string-templates/src/helpers/index.ts b/packages/string-templates/src/helpers/index.ts index 19d4ee3dff..b375426c0b 100644 --- a/packages/string-templates/src/helpers/index.ts +++ b/packages/string-templates/src/helpers/index.ts @@ -7,6 +7,7 @@ import { HelperFunctionBuiltin, LITERAL_MARKER, } from "./constants" + export { getJsHelperList } from "./list" const HTML_SWAPS = { diff --git a/packages/string-templates/src/index.ts b/packages/string-templates/src/index.ts index b5d5590050..a3eb890211 100644 --- a/packages/string-templates/src/index.ts +++ b/packages/string-templates/src/index.ts @@ -1,10 +1,11 @@ -import fs from "fs" import { createContext, runInNewContext } from "vm" import { create } from "handlebars" import { registerAll, registerMinimum } from "./helpers/index" import { preprocess, postprocess } from "./processors" -import { atob, btoa, isBackendService } from "./utilities" import { + atob, + btoa, + isBackendService, FIND_HBS_REGEX, FIND_ANY_HBS_REGEX, findDoubleHbsInstances, @@ -13,6 +14,8 @@ import { convertHBSBlock } from "./conversion" import { setJSRunner, removeJSRunner } from "./helpers/javascript" import { helpersToRemoveForJs } from "./helpers/list" +import manifest from "../manifest.json" + export { setJSRunner, setOnErrorLog } from "./helpers/javascript" const hbsInstance = create() @@ -256,7 +259,6 @@ export function isValid(string, opts?) { * This manifest provides information about each of the helpers and how it can be used. * @returns The manifest JSON which has been generated from the helpers. */ -import manifest from "../manifest.json" export function getManifest() { return manifest } diff --git a/packages/string-templates/test/vm.spec.ts b/packages/string-templates/test/vm.spec.ts index 7bf1612386..0581736af2 100644 --- a/packages/string-templates/test/vm.spec.ts +++ b/packages/string-templates/test/vm.spec.ts @@ -5,8 +5,10 @@ jest.mock("../src/utilities", () => { isBackendService: jest.fn().mockReturnValue(true), } }) -const { defaultJSSetup, processStringSync, encodeJSBinding } = require("../src") -const { isBackendService } = require("../src/utilities") + +import { defaultJSSetup, processStringSync, encodeJSBinding } from "../src" +import { isBackendService } from "../src/utilities" + const mockedBackendService = jest.mocked(isBackendService) const binding = encodeJSBinding("return 1")