mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-24 23:00:22 +03:00
Make codacy happy again, again
This commit is contained in:
1 parent
aad639a5db
commit
a1bb676d00
2 files changed
+4
-8
No files matched your search
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user