From 68777ec421d41be0da27013afd4165ae7d658d26 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Mon, 13 Jul 2026 23:17:25 +0530 Subject: refactor: added linting with esling and also resolved warnings for it --- config/webpack/utils/injected-code.js | 4 ++-- config/webpack/utils/scripts.js | 6 +++--- config/webpack/utils/shared-modules.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'config/webpack/utils') diff --git a/config/webpack/utils/injected-code.js b/config/webpack/utils/injected-code.js index f91fd4a..f2e51c8 100644 --- a/config/webpack/utils/injected-code.js +++ b/config/webpack/utils/injected-code.js @@ -7,7 +7,7 @@ import crypto from "crypto"; * @param {string} url - The URL to hash. * @returns {string} A 16-character hex hash. */ -const getHash = url => +const getHash = (url) => crypto .createHash("md5") .update(url) @@ -50,7 +50,7 @@ export function getInjectedCode(code) { } const extensionAssetsCode = Object.entries(extensionAssets).map( - asset => `"${asset[0]}": chrome.runtime.getURL("${asset[1]}")` + (asset) => `"${asset[0]}": chrome.runtime.getURL("${asset[1]}")` ).join(","); return [code, `{${extensionAssetsCode}}`]; diff --git a/config/webpack/utils/scripts.js b/config/webpack/utils/scripts.js index 09a2fc0..d5a0cdc 100644 --- a/config/webpack/utils/scripts.js +++ b/config/webpack/utils/scripts.js @@ -1,5 +1,5 @@ -import path from "path"; import fs from "fs"; +import path from "path"; /** * Reads `src/scripts.json` and re-indexes it so the outer key is the @@ -11,8 +11,8 @@ import fs from "fs"; */ const scripts = JSON.parse( fs.readFileSync( - path.resolve("./src/scripts.json"), - ), + path.resolve("./src/scripts.json") + ) ); const formattedScripts = {}; diff --git a/config/webpack/utils/shared-modules.js b/config/webpack/utils/shared-modules.js index 74ee555..c9c9618 100644 --- a/config/webpack/utils/shared-modules.js +++ b/config/webpack/utils/shared-modules.js @@ -1,5 +1,5 @@ -import path from "path"; import fs from "fs"; +import path from "path"; /** * Scans `src/shared/` and returns the list of shared module filenames @@ -8,5 +8,5 @@ import fs from "fs"; * @returns {string[]} e.g. `["generate-web-page", "intercept-jquery-ajax", …]` */ export default fs.readdirSync(path.resolve("src/shared")) - .filter(sharedModule => !sharedModule.endsWith("import-shared.js")) - .map(sharedModule => sharedModule.substring(0, sharedModule.length - 3)); + .filter((sharedModule) => !sharedModule.endsWith("import-shared.js")) + .map((sharedModule) => sharedModule.substring(0, sharedModule.length - 3)); -- cgit v1.2.3