Skip to content

Commit 054132f

Browse files
authored
chore: clean up code formatting in may-the-fourth and status commands (#1958)
* refactor: clean up code formatting in may-the-fourth and status commands * chore: remove unused imports from CLI
1 parent 8668cdf commit 054132f

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.changeset/fiery-dingos-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
remove unused imports cli

packages/cli/src/cli/cmd/may-the-fourth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as cp from "node:child_process";
33
import figlet from "figlet";
44
import chalk from "chalk";
55
import { vice } from "gradient-string";
6-
import { setTimeout } from "node:timers/promises";
76

87
export const colors = {
98
orange: "#ff6600",

packages/cli/src/cli/cmd/status.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,10 @@ export default new Command()
354354
)} (${completeKeys.length}/${totalKeysInFile} keys)`,
355355
);
356356
} else {
357-
const message = `[${sourceLocale} -> ${targetLocale}] ${
358-
parseFloat(completionPercent) > 50
357+
const message = `[${sourceLocale} -> ${targetLocale}] ${parseFloat(completionPercent) > 50
359358
? chalk.yellow(`${completionPercent}% complete`)
360359
: chalk.red(`${completionPercent}% complete`)
361-
} (${completeKeys.length}/${totalKeysInFile} keys)`;
360+
} (${completeKeys.length}/${totalKeysInFile} keys)`;
362361

363362
bucketOra.succeed(message);
364363

@@ -368,8 +367,7 @@ export default new Command()
368367
` ${chalk.red(`Missing:`)} ${missingKeys.length} keys, ~${wordsToTranslate} words`,
369368
);
370369
console.log(
371-
` ${chalk.red(`Missing:`)} ${
372-
missingKeys.length
370+
` ${chalk.red(`Missing:`)} ${missingKeys.length
373371
} keys, ~${wordsToTranslate} words`,
374372
);
375373
console.log(
@@ -382,8 +380,7 @@ export default new Command()
382380
}
383381
if (updatedKeys.length > 0) {
384382
console.log(
385-
` ${chalk.yellow(`Updated:`)} ${
386-
updatedKeys.length
383+
` ${chalk.yellow(`Updated:`)} ${updatedKeys.length
387384
} keys that changed in source`,
388385
);
389386
}
@@ -533,13 +530,11 @@ export default new Command()
533530
Object.entries(fileStats)
534531
.sort((a, b) => b[1].wordCount - a[1].wordCount) // Sort by word count
535532
.forEach(([path, stats]) => {
536-
// Skip files with no source keys
537533
if (stats.sourceKeys === 0) return;
538534

539535
console.log(chalk.bold(`\n• ${path}:`));
540536
console.log(
541-
` ${
542-
stats.sourceKeys
537+
` ${stats.sourceKeys
543538
} source keys, ~${stats.wordCount.toLocaleString()} source words`,
544539
);
545540

@@ -606,16 +601,14 @@ export default new Command()
606601

607602
if (missingLanguages.length > 0) {
608603
console.log(
609-
`• ${chalk.yellow(missingLanguages.join(", "))} ${
610-
missingLanguages.length === 1 ? "has" : "have"
604+
`• ${chalk.yellow(missingLanguages.join(", "))} ${missingLanguages.length === 1 ? "has" : "have"
611605
} no translations yet`,
612606
);
613607
}
614608

615609
if (completeLanguages.length > 0) {
616610
console.log(
617-
`• ${chalk.green(completeLanguages.join(", "))} ${
618-
completeLanguages.length === 1 ? "is" : "are"
611+
`• ${chalk.green(completeLanguages.join(", "))} ${completeLanguages.length === 1 ? "is" : "are"
619612
} completely translated`,
620613
);
621614
}

0 commit comments

Comments
 (0)