fix(lint): resolve biome formatting and unused variables across codebase
This commit is contained in:
1 parent
91008d84fe
commit
0af8d8a398
27 files changed
+117890
-117872
No files matched your search
@@ -7,8 +7,16 @@ const enData = JSON.parse(fs.readFileSync(enPath, "utf8"));
|
|||||||
|
|
||||||
function deepMerge(target, source) {
|
function deepMerge(target, source) {
|
||||||
for (const key of Object.keys(source)) {
|
for (const key of Object.keys(source)) {
|
||||||
if (source[key] && typeof source[key] === "object" && !Array.isArray(source[key])) {
|
if (
|
||||||
if (!target[key] || typeof target[key] !== "object" || Array.isArray(target[key])) {
|
source[key] &&
|
||||||
|
typeof source[key] === "object" &&
|
||||||
|
!Array.isArray(source[key])
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
!target[key] ||
|
||||||
|
typeof target[key] !== "object" ||
|
||||||
|
Array.isArray(target[key])
|
||||||
|
) {
|
||||||
target[key] = {};
|
target[key] = {};
|
||||||
}
|
}
|
||||||
deepMerge(target[key], source[key]);
|
deepMerge(target[key], source[key]);
|
||||||
@@ -21,14 +29,16 @@ function deepMerge(target, source) {
|
|||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
const files = fs.readdirSync(messagesDir).filter((f) => f.endsWith(".json") && f !== "en.json");
|
const files = fs
|
||||||
|
.readdirSync(messagesDir)
|
||||||
|
.filter((f) => f.endsWith(".json") && f !== "en.json");
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const filePath = path.join(messagesDir, file);
|
const filePath = path.join(messagesDir, file);
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||||
deepMerge(data, enData);
|
deepMerge(data, enData);
|
||||||
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf8");
|
fs.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf8");
|
||||||
console.log(`Synced ${file}`);
|
console.log(`Synced ${file}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`Error syncing ${file}:`, err);
|
console.error(`Error syncing ${file}:`, err);
|
||||||
|
|||||||
@@ -387,21 +387,21 @@ export function OrganizeImportsDialog({
|
|||||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||||
<DialogContent className="flex h-[90vh] max-h-[90vh] w-[800px] max-w-[95vw] flex-col overflow-hidden p-0">
|
<DialogContent className="flex h-[90vh] max-h-[90vh] w-[800px] max-w-[95vw] flex-col overflow-hidden p-0">
|
||||||
<DialogHeader className="flex-none border-b px-4 py-3">
|
<DialogHeader className="flex-none border-b px-4 py-3">
|
||||||
<DialogTitle className="flex items-center gap-2 text-sm font-semibold">
|
<DialogTitle className="flex items-center gap-2 text-sm font-semibold">
|
||||||
<FolderTree className="h-4 w-4" />
|
<FolderTree className="h-4 w-4" />
|
||||||
{t("title")}
|
{t("title")}
|
||||||
{totalSelected > 0 && !loading && (
|
{totalSelected > 0 && !loading && (
|
||||||
<Badge variant="secondary" className="text-[10px]">
|
<Badge variant="secondary" className="text-[10px]">
|
||||||
{t("itemsBadge", { count: totalSelected })}
|
{t("itemsBadge", { count: totalSelected })}
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
<div className="flex-1 text-[10px] text-muted-foreground ml-2">
|
<div className="flex-1 text-[10px] text-muted-foreground ml-2">
|
||||||
{moveMode
|
{moveMode ? t("tipMove") : t("tipCreate")}
|
||||||
? t("tipMove")
|
</div>
|
||||||
: t("tipCreate")}
|
<p className="text-xs text-muted-foreground ml-2">
|
||||||
</div>
|
{t("limitHint")}
|
||||||
<p className="text-xs text-muted-foreground ml-2">{t("limitHint")}</p>
|
</p>
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
<div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4">
|
<div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4">
|
||||||
@@ -488,7 +488,10 @@ export function OrganizeImportsDialog({
|
|||||||
type="button"
|
type="button"
|
||||||
variant={!moveMode ? "default" : "outline"}
|
variant={!moveMode ? "default" : "outline"}
|
||||||
size="sm"
|
size="sm"
|
||||||
className={cn("h-7 px-3 text-[11px] gap-1.5", !moveMode && "ring-2 ring-primary ring-offset-1")}
|
className={cn(
|
||||||
|
"h-7 px-3 text-[11px] gap-1.5",
|
||||||
|
!moveMode && "ring-2 ring-primary ring-offset-1",
|
||||||
|
)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setMoveMode(false);
|
setMoveMode(false);
|
||||||
setDestinationPageId(null);
|
setDestinationPageId(null);
|
||||||
@@ -502,7 +505,10 @@ export function OrganizeImportsDialog({
|
|||||||
type="button"
|
type="button"
|
||||||
variant={moveMode ? "default" : "outline"}
|
variant={moveMode ? "default" : "outline"}
|
||||||
size="sm"
|
size="sm"
|
||||||
className={cn("h-7 px-3 text-[11px] gap-1.5", moveMode && "ring-2 ring-primary ring-offset-1")}
|
className={cn(
|
||||||
|
"h-7 px-3 text-[11px] gap-1.5",
|
||||||
|
moveMode && "ring-2 ring-primary ring-offset-1",
|
||||||
|
)}
|
||||||
onClick={() => setMoveMode(true)}
|
onClick={() => setMoveMode(true)}
|
||||||
>
|
>
|
||||||
<ArrowRight className="h-3.5 w-3.5" />
|
<ArrowRight className="h-3.5 w-3.5" />
|
||||||
@@ -703,7 +709,9 @@ export function OrganizeImportsDialog({
|
|||||||
<SelectContent>
|
<SelectContent>
|
||||||
{CATALOG_LAYOUTS.map((l) => (
|
{CATALOG_LAYOUTS.map((l) => (
|
||||||
<SelectItem key={l} value={l} className="text-xs">
|
<SelectItem key={l} value={l} className="text-xs">
|
||||||
{l === "default_3x3" ? t("layoutFallbackDefault3x3") : l}
|
{l === "default_3x3"
|
||||||
|
? t("layoutFallbackDefault3x3")
|
||||||
|
: l}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
@@ -969,7 +977,7 @@ export function OrganizeImportsDialog({
|
|||||||
? thumb.sourcePageCaption.replace(
|
? thumb.sourcePageCaption.replace(
|
||||||
new RegExp(`^${t("impPrefix")}`),
|
new RegExp(`^${t("impPrefix")}`),
|
||||||
"",
|
"",
|
||||||
)
|
)
|
||||||
: t("isMoved")}
|
: t("isMoved")}
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export async function generateScale32(input: Buffer): Promise<{
|
|||||||
let resolved: ReturnType<typeof resolveNitroFrame>;
|
let resolved: ReturnType<typeof resolveNitroFrame>;
|
||||||
try {
|
try {
|
||||||
resolved = resolveNitroFrame(json, name);
|
resolved = resolveNitroFrame(json, name);
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
skipped.add(name);
|
skipped.add(name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+4906
-4906
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4906
-4906
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4906
-4906
File diff suppressed because it is too large.
Load diff
+4912
-4912
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4909
-4909
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
+4911
-4911
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user