mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-15 13:30:06 +02:00
Add more ESLint rules and change the formatting scripts (#626)
* Add curly rule in ESLint for consistency * Fix rules * More rules * REturn * Push * no else return * prefer const * destructing
This commit is contained in:
@@ -43,12 +43,12 @@ export function t(path: string, replacement?: { [key: string]: string }) {
|
||||
findPartsForData(currentLanguage.data, parts) ||
|
||||
findPartsForData(fallbackLanguage.data, parts);
|
||||
if (translation === undefined) {
|
||||
throw new Error("Can't find translation for " + path);
|
||||
throw new Error(`Can't find translation for ${path}`);
|
||||
}
|
||||
|
||||
if (replacement) {
|
||||
for (var key in replacement) {
|
||||
translation = translation.replace("{{" + key + "}}", replacement[key]);
|
||||
translation = translation.replace(`{{${key}}}`, replacement[key]);
|
||||
}
|
||||
}
|
||||
return translation;
|
||||
|
Reference in New Issue
Block a user