From 61422e171f6517052028a482b8d706c5934ebd49 Mon Sep 17 00:00:00 2001 From: Yoel Ridgway-Lopez Date: Mon, 10 Feb 2025 17:35:55 +0100 Subject: [PATCH] fixed linting issues --- src/serve_rendered.js | 10 +++++++++- src/serve_style.js | 2 +- src/server.js | 4 +--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/serve_rendered.js b/src/serve_rendered.js index 0a00d49..5d87b20 100644 --- a/src/serve_rendered.js +++ b/src/serve_rendered.js @@ -1032,7 +1032,15 @@ export const serve_rendered = { * @param {Function} dataResolver Function to resolve data. * @returns {Promise} */ - add: async function (options, repo, params, id, programOpts, style, dataResolver) { + add: async function ( + options, + repo, + params, + id, + programOpts, + style, + dataResolver, + ) { const map = { renderers: [], renderersStatic: [], diff --git a/src/serve_style.js b/src/serve_style.js index 250a4eb..2e19d3f 100644 --- a/src/serve_style.js +++ b/src/serve_style.js @@ -213,7 +213,7 @@ export const serve_style = { reportFont, ) { const { publicUrl } = programOpts; - const styleFile = path.resolve(options.paths.styles, params.style) + const styleFile = path.resolve(options.paths.styles, params.style); const styleJSON = clone(style); const validationErrors = validateStyleMin(styleJSON); diff --git a/src/server.js b/src/server.js index e5bc96b..ea8c69a 100644 --- a/src/server.js +++ b/src/server.js @@ -185,13 +185,12 @@ async function start(opts) { let styleJSON; try { - if (isValidHttpUrl(item.style)){ + if (isValidHttpUrl(item.style)) { const res = await fetch(item.style); if (!res.ok) { throw new Error(`fetch error ${res.status}`); } styleJSON = await res.json(); - } else { const styleFile = path.resolve(options.paths.styles, item.style); const styleFileData = await fs.promises.readFile(styleFile); @@ -302,7 +301,6 @@ async function start(opts) { console.log(`Missing "style" property for ${id}`); continue; } - startupPromises.push(addStyle(id, item, true, true)); } startupPromises.push(