Apply prettier formatting

This commit is contained in:
Michael Weimann 2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
1576 changed files with 65385 additions and 62478 deletions

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import SdkConfig, { DEFAULTS } from '../../src/SdkConfig';
import SdkConfig, { DEFAULTS } from "../../src/SdkConfig";
// uninitialised SdkConfig causes lots of warnings in console
// init with defaults

View file

@ -34,7 +34,7 @@ function weblateToCounterpart(inTrs: object): object {
const outTrs = {};
for (const key of Object.keys(inTrs)) {
const keyParts = key.split('|', 2);
const keyParts = key.split("|", 2);
if (keyParts.length === 2) {
let obj = outTrs[keyParts[0]];
if (obj === undefined) {
@ -43,7 +43,7 @@ function weblateToCounterpart(inTrs: object): object {
// This is a transitional edge case if a string went from singular to pluralised and both still remain
// in the translation json file. Use the singular translation as `other` and merge pluralisation atop.
obj = outTrs[keyParts[0]] = {
"other": inTrs[key],
other: inTrs[key],
};
console.warn("Found entry in i18n file in both singular and pluralised form", keyParts[0]);
}
@ -58,22 +58,22 @@ function weblateToCounterpart(inTrs: object): object {
fetchMock
.get("/i18n/languages.json", {
"en": {
"fileName": "en_EN.json",
"label": "English",
en: {
fileName: "en_EN.json",
label: "English",
},
"de": {
"fileName": "de_DE.json",
"label": "German",
de: {
fileName: "de_DE.json",
label: "German",
},
"lv": {
"fileName": "lv.json",
"label": "Latvian",
lv: {
fileName: "lv.json",
label: "Latvian",
},
})
.get("end:en_EN.json", weblateToCounterpart(en))
.get("end:de_DE.json", weblateToCounterpart(de))
.get("end:lv.json", weblateToCounterpart(lv));
languageHandler.setLanguage('en');
languageHandler.setMissingEntryGenerator(key => key.split("|", 2)[1]);
languageHandler.setLanguage("en");
languageHandler.setMissingEntryGenerator((key) => key.split("|", 2)[1]);

View file

@ -16,12 +16,12 @@ limitations under the License.
import fetchMock from "fetch-mock-jest";
import { TextDecoder, TextEncoder } from "util";
import fetch from 'node-fetch';
import fetch from "node-fetch";
// jest 27 removes setImmediate from jsdom
// polyfill until setImmediate use in client can be removed
// @ts-ignore - we know the contract is wrong. That's why we're stubbing it.
global.setImmediate = callback => window.setTimeout(callback, 0);
global.setImmediate = (callback) => window.setTimeout(callback, 0);
// Stub ResizeObserver
// @ts-ignore - we know it's a duplicate (that's why we're stubbing it)
@ -56,7 +56,7 @@ class MyClipboardEvent extends Event {}
window.ClipboardEvent = MyClipboardEvent as any;
// matchMedia is not included in jsdom
const mockMatchMedia = jest.fn().mockImplementation(query => ({
const mockMatchMedia = jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,