From 95df3522a15631abc51a4295cae0ea401a8d4e1e Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 14 Sep 2021 19:58:52 +0200 Subject: feat: add eslint-plugin-unicorn (#1936) --- src/i18n/translations.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/i18n/translations.js') diff --git a/src/i18n/translations.js b/src/i18n/translations.js index 161a172ba..9a7dc7453 100644 --- a/src/i18n/translations.js +++ b/src/i18n/translations.js @@ -1,13 +1,15 @@ +/* eslint-disable global-require */ import { APP_LOCALES } from './languages'; const translations = []; -Object.keys(APP_LOCALES).forEach((key) => { +for (const key of Object.keys(APP_LOCALES)) { try { - const translation = require(`./locales/${key}.json`); // eslint-disable-line + // eslint-disable-next-line import/no-dynamic-require + const translation = require(`./locales/${key}.json`); translations[key] = translation; - } catch (err) { + } catch { console.warn(`Can't find translations for ${key}`); } -}); +} module.exports = translations; -- cgit v1.2.3-70-g09d2