From 210678294fd3df3443e6e2f96af1f0112903062b Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Sat, 5 Oct 2024 10:45:29 +0800 Subject: [PATCH] * Import list of locales from another file --- eslint.config.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index f76d22d8dc01e..5840c23b6997f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,6 +11,9 @@ import js from '@eslint/js' import { FlatCompat } from '@eslint/eslintrc' import { fixupConfigRules } from '@eslint/compat' +const { default: activeLocales } = + await import('./static/locales/activeLocales.json', { with: { type: 'json' } }) + const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) const compat = new FlatCompat({ @@ -56,7 +59,7 @@ export default [ settings: { 'vue-i18n': { - localeDir: './static/locales/{en-US,en-GB,ar,bg,ca,cs,da,de-DE,el,es,es-AR,es-MX,et,eu,fa,fi,fr-FR,gl,he,hu,hr,id,is,it,ja,ko,lt,nb-NO,nl,nn,pl,pt,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,tr,uk,vi,zh-CN,zh-TW}.yaml', + localeDir: `./static/locales/{${activeLocales.join(',')}}.yaml`, messageSyntaxVersion: '^8.0.0', }, },