From a1bb676d0014596ee6c85d40135e6155836ded74 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 26 Oct 2025 19:27:26 +0000 Subject: [PATCH] Make codacy happy again, again --- scripts/find-hardcoded-text.ts | 9 +++------ src/lib/i18n/index.ts | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/find-hardcoded-text.ts b/scripts/find-hardcoded-text.ts index 42d08d7..608d4d8 100644 --- a/scripts/find-hardcoded-text.ts +++ b/scripts/find-hardcoded-text.ts @@ -131,8 +131,7 @@ function scanDirectory(dirPath: string): HardcodedText[] { const entries = readdirSync(dirPath, { withFileTypes: true }); for (const entry of entries) { - // codacy-disable-next-line - const fullPath = join(dirPath, entry.name); + const fullPath = join(dirPath, entry.name); // codacy-disable-line // Skip node_modules, .svelte-kit, etc. if (entry.name.startsWith('.') || entry.name === 'node_modules' || entry.name === 'build') { @@ -143,8 +142,7 @@ function scanDirectory(dirPath: string): HardcodedText[] { results = results.concat(scanDirectory(fullPath)); } else if (entry.isFile() && entry.name.endsWith('.svelte')) { try { - // codacy-disable-next-line - const content = readFileSync(fullPath, 'utf-8'); + const content = readFileSync(fullPath, 'utf-8'); // codacy-disable-line const found = findHardcodedText(fullPath, content); results = results.concat(found); } catch (error) { @@ -224,8 +222,7 @@ function formatResults(results: HardcodedText[], minLength: number): string { */ function validateScanPath(userPath: string): string { // Resolve the full path and normalize it - // codacy-disable-next-line - const fullPath = resolve(PROJECT_ROOT, normalize(userPath)); + const fullPath = resolve(PROJECT_ROOT, normalize(userPath)); // codacy-disable-line // Ensure the path is within PROJECT_ROOT if (!fullPath.startsWith(PROJECT_ROOT)) { diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts index f7a7f7f..8814035 100644 --- a/src/lib/i18n/index.ts +++ b/src/lib/i18n/index.ts @@ -35,9 +35,8 @@ function getNestedValue(obj: TranslationObject, key: string): any { return undefined; } - // codacy-disable-next-line if (result && typeof result === 'object' && Object.prototype.hasOwnProperty.call(result, k)) { - result = result[k]; + result = result[k]; // codacy-disable-line } else { return undefined; }