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) {
|
||||
for (const key of Object.keys(source)) {
|
||||
if (source[key] && typeof source[key] === "object" && !Array.isArray(source[key])) {
|
||||
if (!target[key] || typeof target[key] !== "object" || Array.isArray(target[key])) {
|
||||
if (
|
||||
source[key] &&
|
||||
typeof source[key] === "object" &&
|
||||
!Array.isArray(source[key])
|
||||
) {
|
||||
if (
|
||||
!target[key] ||
|
||||
typeof target[key] !== "object" ||
|
||||
Array.isArray(target[key])
|
||||
) {
|
||||
target[key] = {};
|
||||
}
|
||||
deepMerge(target[key], source[key]);
|
||||
@@ -21,14 +29,16 @@ function deepMerge(target, source) {
|
||||
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) {
|
||||
const filePath = path.join(messagesDir, file);
|
||||
try {
|
||||
const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||
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}`);
|
||||
} catch (err) {
|
||||
console.error(`Error syncing ${file}:`, err);
|
||||
|
||||
Reference in new issue
Block a user