fix(test): Resolve JSDoc and no-useless-escape lint issues in check-translations.test.js

This commit is contained in:
Frank Elsinga 2026-01-06 00:17:26 +01:00
parent 2bb03b07cb
commit 7af6a34f20

View File

@ -4,7 +4,10 @@ const fs = require("fs");
const path = require("path"); const path = require("path");
/** /**
* @param dir * Recursively walks a directory and yields file paths.
* @param {string} dir The directory to walk.
* @yields {string} The path to a file.
* @returns {Generator<string>} A generator that yields file paths.
*/ */
function* walk(dir) { function* walk(dir) {
const files = fs.readdirSync(dir, { withFileTypes: true }); const files = fs.readdirSync(dir, { withFileTypes: true });
@ -21,7 +24,7 @@ describe("Check Translations", () => {
it("should not have missing translation keys", () => { it("should not have missing translation keys", () => {
const enTranslations = JSON.parse(fs.readFileSync("src/lang/en.json", "utf-8")); const enTranslations = JSON.parse(fs.readFileSync("src/lang/en.json", "utf-8"));
const translationRegex = /\$t\(['"](?<key1>.*?)['"]\s*[,)]|i18n-t\s+keypath=\"(?<key2>[^\"]+)\"/g; const translationRegex = /\$t\(['"](?<key1>.*?)['"]\s*[,)]|i18n-t\s+keypath=\x22(?<key2>[^\x22]+)\x22/g;
const missingKeys = []; const missingKeys = [];