From 609ffe431958aba6a6862583866b1dff73b1ab1b Mon Sep 17 00:00:00 2001 From: Amer Harb Date: Mon, 27 Nov 2023 13:22:45 +0100 Subject: [PATCH] eslint --- webapp/.eslintrc.js | 2 +- webapp/src/app/api/translations/[lang]/route.ts | 2 ++ webapp/src/types.ts | 2 +- webapp/src/utils/readTypedMessages.ts | 2 +- webapp/src/utils/util.ts | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/webapp/.eslintrc.js b/webapp/.eslintrc.js index 58e0853f..f89004ec 100644 --- a/webapp/.eslintrc.js +++ b/webapp/.eslintrc.js @@ -24,7 +24,7 @@ module.exports = { es6: true, }, extends: [ - // 'plugin:@typescript-eslint/recommended', // TypeScript rules + 'plugin:@typescript-eslint/recommended', // TypeScript rules 'plugin:react-hooks/recommended', // React hooks rules 'plugin:jsx-a11y/recommended', // Accessibility rules ], diff --git a/webapp/src/app/api/translations/[lang]/route.ts b/webapp/src/app/api/translations/[lang]/route.ts index c572f66e..a6b0bbfb 100644 --- a/webapp/src/app/api/translations/[lang]/route.ts +++ b/webapp/src/app/api/translations/[lang]/route.ts @@ -16,9 +16,11 @@ export async function GET( } function flattenObject( + // eslint-disable-next-line @typescript-eslint/no-explicit-any obj: Record, parentKey: string = '', ): Record { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const result: Record = {}; for (const key in obj) { diff --git a/webapp/src/types.ts b/webapp/src/types.ts index 193638ca..31906cf2 100644 --- a/webapp/src/types.ts +++ b/webapp/src/types.ts @@ -1,6 +1,6 @@ export type LanguageMap = Map>; declare global { - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line var languages: LanguageMap; } diff --git a/webapp/src/utils/readTypedMessages.ts b/webapp/src/utils/readTypedMessages.ts index 1e1e9fc7..c6c3bed8 100644 --- a/webapp/src/utils/readTypedMessages.ts +++ b/webapp/src/utils/readTypedMessages.ts @@ -32,8 +32,8 @@ export default function readTypedMessages(fileName: string) { type TypeID = string; export type MessageData = { - id: string; defaultMessage: string; + id: string; params: { name: string; types: TypeID[]; diff --git a/webapp/src/utils/util.ts b/webapp/src/utils/util.ts index abb6b82d..2b427bac 100644 --- a/webapp/src/utils/util.ts +++ b/webapp/src/utils/util.ts @@ -12,6 +12,7 @@ export function logInfo(msg: string) { console.info(msg); } +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function logError(msg: any) { // eslint-disable-next-line no-console console.error(msg)