diff --git a/eslint.config.js b/eslint.config.js index 6c312e996..9495a5175 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -43,7 +43,6 @@ export default [ { rules: { // Disable rules that would fail. The failures should be fixed, and the entries here removed. - "@typescript-eslint/no-explicit-any": "off", // https://github.com/openfrontio/OpenFrontIO/issues/1789 "@typescript-eslint/no-unused-expressions": "off", // https://github.com/openfrontio/OpenFrontIO/issues/1790 "no-case-declarations": "off", // https://github.com/openfrontio/OpenFrontIO/issues/1791 }, @@ -88,7 +87,7 @@ export default [ "eqeqeq": "error", "indent": "off", // @stylistic/ts/indent "sort-keys": "error", - // "@typescript-eslint/no-unsafe-argument": "error", // TODO: Enable this rule, https://github.com/openfrontio/OpenFrontIO/issues/1780 + "@typescript-eslint/no-unsafe-argument": "error", // "@typescript-eslint/no-unsafe-assignment": "error", // TODO: Enable this rule, https://github.com/openfrontio/OpenFrontIO/issues/1781 // "@typescript-eslint/no-unsafe-member-access": "error", // TODO: Enable this rule, https://github.com/openfrontio/OpenFrontIO/issues/1783 // "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], // TODO: Enable this rule, https://github.com/openfrontio/OpenFrontIO/issues/1784 @@ -108,6 +107,7 @@ export default [ "max-lines-per-function": ["error", { max: 561 }], "no-loss-of-precision": "error", "no-multi-spaces": "error", + "no-trailing-spaces": "error", "object-curly-newline": ["error", { multiline: true, consistent: true }], "object-curly-spacing": ["error", "always"], "object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }], @@ -133,6 +133,7 @@ export default [ rules: { // Disabled rules for tests, configs "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unsafe-argument": "off", "sort-keys": "off", }, }, diff --git a/src/client/LangSelector.ts b/src/client/LangSelector.ts index b55c78955..2aad69116 100644 --- a/src/client/LangSelector.ts +++ b/src/client/LangSelector.ts @@ -125,6 +125,7 @@ export class LangSelector extends LitElement { private loadLanguage(lang: string): Record { const language = this.languageMap[lang] ?? {}; + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const flat = flattenTranslations(language); return flat; } @@ -186,6 +187,7 @@ export class LangSelector extends LitElement { if (currentLangEntry) finalList.push(currentLangEntry); if (englishEntry) finalList.push(englishEntry); if (browserLangEntry) finalList.push(browserLangEntry); + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument finalList.push(...list); if (debugLang) finalList.push(debugLang); @@ -316,6 +318,7 @@ export class LangSelector extends LitElement { .languageList=${this.languageList} .currentLang=${this.currentLang} @language-selected=${(e: CustomEvent) => + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument this.changeLanguage(e.detail.lang)} @close-modal=${() => (this.showModal = false)} > @@ -336,6 +339,7 @@ function flattenTranslations( if (typeof value === "string") { result[fullKey] = value; } else if (value && typeof value === "object" && !Array.isArray(value)) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument flattenTranslations(value, fullKey, result); } else { console.warn("Unknown type", typeof value, value); diff --git a/src/client/LanguageModal.ts b/src/client/LanguageModal.ts index 236715d03..73c4a1b1f 100644 --- a/src/client/LanguageModal.ts +++ b/src/client/LanguageModal.ts @@ -106,7 +106,9 @@ export class LanguageModal extends LitElement { return html`