diff --git a/frontend/public/index.html b/frontend/public/index.html index e16866f4f..0dd551976 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -2,16 +2,19 @@ - + - + - + Nebraska diff --git a/frontend/src/i18n/config.ts b/frontend/src/i18n/config.ts index 30ded211d..05afb0d18 100644 --- a/frontend/src/i18n/config.ts +++ b/frontend/src/i18n/config.ts @@ -16,7 +16,7 @@ i18next read( language: string | any, namespace: Namespace, - callback: (errorValue: unknown, translations: null | typeof en[Namespace]) => void + callback: (errorValue: unknown, translations: null | (typeof en)[Namespace]) => void ) { import(`./locales/${language}/${namespace}.json`) .then(resources => { diff --git a/frontend/tools/build-icons.js b/frontend/tools/build-icons.js index 83f04ad3d..6e5f68a1c 100644 --- a/frontend/tools/build-icons.js +++ b/frontend/tools/build-icons.js @@ -6,7 +6,7 @@ * * @todo: Make this a webpack loader. */ -"use strict"; +'use strict'; const fs = require('fs'); const path = require('path'); @@ -18,60 +18,66 @@ let sourceDir = args[0]; let destDir = args[1]; if (!fs.existsSync(sourceDir)) { - console.log(`Input folder ${sourceDir} does not exist; quitting...`); - process.exit(1); + console.log(`Input folder ${sourceDir} does not exist; quitting...`); + process.exit(1); } // Create directories try { - fs.mkdirSync(destDir); + fs.mkdirSync(destDir); } catch (err) { - if (err.code !== 'EEXIST') { - console.log(err); - } + if (err.code !== 'EEXIST') { + console.log(err); + } } // Do stuff -tools.ImportDir(sourceDir).then(result => { +tools + .ImportDir(sourceDir) + .then(result => { collection = result; console.log('Found ' + collection.length() + ' icons.'); // SVGO optimization return collection.promiseAll(svg => tools.SVGO(svg)); -}).then(() => { + }) + .then(() => { // Clean up tags return collection.promiseAll(svg => tools.Tags(svg)); -}).then(() => { + }) + .then(() => { // SVGO optimization again. Might make files smaller after color/tags changes return collection.promiseAll(svg => tools.SVGO(svg)); -}).then(() => { + }) + .then(() => { // Export each icon as JSON collection.forEach((item, key) => { - let json = { - body: item.getBody().replace(/\s*\n\s*/g, ''), - width: item.width, - height: item.height - }; - let content = JSON.stringify(json, null, '\t'); - let target = path.join(destDir, `${key}.json`); + let json = { + body: item.getBody().replace(/\s*\n\s*/g, ''), + width: item.width, + height: item.height, + }; + let content = JSON.stringify(json, null, '\t'); + let target = path.join(destDir, `${key}.json`); + try { try { - try { - fs.mkdirSync(destDir); - } catch (err) { - if (err.code !== 'EEXIST') { - console.log(err); - process.exit(1); - } - } - - fs.writeFileSync(target, content, 'utf8'); - console.log(`Created ${target}`); + fs.mkdirSync(destDir); } catch (err) { + if (err.code !== 'EEXIST') { console.log(err); process.exit(1); + } } + + fs.writeFileSync(target, content, 'utf8'); + console.log(`Created ${target}`); + } catch (err) { + console.log(err); + process.exit(1); + } }); -}).catch(err => { + }) + .catch(err => { console.log(err); -}); + }); diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 5ab66b819..274e1eb7f 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "es6", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -20,7 +16,5 @@ "jsx": "react-jsx", "noFallthroughCasesInSwitch": true }, - "include": [ - "src" - ] -} \ No newline at end of file + "include": ["src"] +}