mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
fix test lint
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
let glob = require('glob').sync;
|
||||
const glob = require('glob').sync;
|
||||
|
||||
describe('Locales files', () => {
|
||||
it('do not contain duplicates of any keys', () => {
|
||||
let translationFiles = glob('./website/common/locales/en/*.json');
|
||||
const translationFiles = glob('./website/common/locales/en/*.json');
|
||||
|
||||
if (translationFiles.length === 0) {
|
||||
throw new Error('Could not find any files in ./website/common/locales/en/*.json');
|
||||
}
|
||||
|
||||
let keys = {};
|
||||
const keys = {};
|
||||
|
||||
translationFiles.forEach((file) => {
|
||||
let json = require(`../.${file}`); // eslint-disable-line global-require
|
||||
translationFiles.forEach(file => {
|
||||
const json = require(`../.${file}`); // eslint-disable-line global-require, import/no-dynamic-require
|
||||
|
||||
Object.keys(json).forEach((key) => {
|
||||
Object.keys(json).forEach(key => {
|
||||
if (keys[key]) {
|
||||
throw new Error(`${key} in ${file} already exists in ${keys[key]}.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user