From 1587a44cd7ae8c6f6b7445f21a505fd8f2a052b6 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Fri, 19 Jun 2020 12:26:04 +0530 Subject: [PATCH] Lint --- assets/css/fonts.scss | 14 ++++---------- assets/css/styles.scss | 6 +++--- assets/js/curlparser.js | 12 ++++++------ assets/js/oauth.js | 14 +++++++------- assets/js/pwa.js | 4 ++-- components/collections/collection.vue | 2 +- components/collections/editCollection.vue | 4 ++-- components/collections/editFolder.vue | 2 +- components/collections/editRequest.vue | 2 +- components/collections/folder.vue | 2 +- components/collections/index.vue | 3 ++- components/collections/request.vue | 2 +- components/environments/index.vue | 3 ++- components/firebase/logout.vue | 2 +- components/graphql/field.vue | 2 +- components/layout/header.vue | 11 ++++------- components/layout/logo.vue | 4 ++-- components/realtime/log.vue | 4 ++-- components/realtime/mqtt.vue | 2 +- components/ui/ace-editor.vue | 2 +- components/ui/autocomplete.vue | 4 ++-- components/ui/modal.vue | 2 +- components/ui/tabs.vue | 6 +++--- functions/postwomanTesting.js | 4 ++-- functions/utils/debounce.js | 2 +- middleware/parsedefaulturl.js | 2 +- static/fonts/material-icons-v48.woff2 | Bin 60840 -> 0 bytes static/fonts/material-icons-v52.woff2 | Bin 0 -> 79448 bytes store/mutations.js | 2 +- tests/e2e/integration/app.starter.spec.js | 4 +--- .../e2e/integration/feature.url-queries.spec.js | 4 ++-- tests/e2e/integration/proxy.spec.js | 2 +- tests/e2e/support/commands.js | 11 +++-------- 33 files changed, 63 insertions(+), 77 deletions(-) delete mode 100644 static/fonts/material-icons-v48.woff2 create mode 100644 static/fonts/material-icons-v52.woff2 diff --git a/assets/css/fonts.scss b/assets/css/fonts.scss index ecb70d187..d1c89084e 100644 --- a/assets/css/fonts.scss +++ b/assets/css/fonts.scss @@ -9,7 +9,7 @@ // Do not use font-display: swap for the icon font - it looks really bad when the page // loads. font-display: block; - src: url("~static/fonts/material-icons-v48.woff2") format("woff2"); + src: url("~static/fonts/material-icons-v52.woff2") format("woff2"); } .material-icons { @@ -40,9 +40,7 @@ font-display: swap; src: local("Poppins Medium"), local("Poppins-Medium"), url("~static/fonts/poppins-v9-latin-500.woff2") format("woff2"), - /* Chrome 26+, Opera 23+, Firefox 39+ */ - url("~static/fonts/poppins-v9-latin-500.woff") format("woff"); - /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url("~static/fonts/poppins-v9-latin-500.woff") format("woff"); } /* poppins-700 - latin */ @@ -53,9 +51,7 @@ font-display: swap; src: local("Poppins Bold"), local("Poppins-Bold"), url("~static/fonts/poppins-v9-latin-700.woff2") format("woff2"), - /* Chrome 26+, Opera 23+, Firefox 39+ */ - url("~static/fonts/poppins-v9-latin-700.woff") format("woff"); - /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url("~static/fonts/poppins-v9-latin-700.woff") format("woff"); } /* roboto-mono-regular - latin */ @@ -66,7 +62,5 @@ font-display: swap; src: local("Roboto Mono"), local("RobotoMono-Regular"), url("~static/fonts/roboto-mono-v7-latin-regular.woff2") format("woff2"), - /* Chrome 26+, Opera 23+, Firefox 39+ */ - url("~static/fonts/roboto-mono-v7-latin-regular.woff") format("woff"); - /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url("~static/fonts/roboto-mono-v7-latin-regular.woff") format("woff"); } diff --git a/assets/css/styles.scss b/assets/css/styles.scss index ec15fc503..9004e0d5c 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -389,7 +389,7 @@ button { // justify-content: center; margin: 4px; padding: 6px 16px; - border-radius: 20px; + border-radius: 8px; background-color: var(--ac-color); color: var(--act-color); font-size: 16px; @@ -457,7 +457,7 @@ button { fieldset { margin: 16px 0; - border-radius: 16px; + border-radius: 8px; background-color: var(--bg-dark-color); transition: all 0.2s ease-in-out; @@ -814,7 +814,7 @@ ol li { section { display: flex; flex-wrap: wrap; - border-radius: 16px; + border-radius: 8px; } .toasted-container .toasted { diff --git a/assets/js/curlparser.js b/assets/js/curlparser.js index fb0a2fc39..a0d097eb1 100644 --- a/assets/js/curlparser.js +++ b/assets/js/curlparser.js @@ -7,7 +7,7 @@ import * as querystring from "querystring" * output this: 'msg1=value1&msg2=value2' * @param dataArguments */ -const joinDataArguments = dataArguments => { +const joinDataArguments = (dataArguments) => { let data = "" dataArguments.forEach((argument, i) => { if (i === 0) { @@ -19,7 +19,7 @@ const joinDataArguments = dataArguments => { return data } -const parseCurlCommand = curlCommand => { +const parseCurlCommand = (curlCommand) => { let newlineFound = /\r|\n/.exec(curlCommand) if (newlineFound) { // remove newlines @@ -47,7 +47,7 @@ const parseCurlCommand = curlCommand => { } let headers - const parseHeaders = headerFieldName => { + const parseHeaders = (headerFieldName) => { if (parsedArguments[headerFieldName]) { if (!headers) { headers = {} @@ -55,7 +55,7 @@ const parseCurlCommand = curlCommand => { if (!Array.isArray(parsedArguments[headerFieldName])) { parsedArguments[headerFieldName] = [parsedArguments[headerFieldName]] } - parsedArguments[headerFieldName].forEach(header => { + parsedArguments[headerFieldName].forEach((header) => { if (header.includes("Cookie")) { // stupid javascript tricks: closure cookieString = header @@ -95,7 +95,7 @@ const parseCurlCommand = curlCommand => { if (!Array.isArray(parsedArguments.F)) { parsedArguments.F = [parsedArguments.F] } - parsedArguments.F.forEach(multipartArgument => { + parsedArguments.F.forEach((multipartArgument) => { // input looks like key=value. value could be json or a file path prepended with an @ const [key, value] = multipartArgument.split("=", 2) multipartUploads[key] = value @@ -103,7 +103,7 @@ const parseCurlCommand = curlCommand => { } if (cookieString) { const cookieParseOptions = { - decode: s => s, + decode: (s) => s, } // separate out cookie headers into separate data structure // note: cookie is case insensitive diff --git a/assets/js/oauth.js b/assets/js/oauth.js index a37ddeb40..bebac822c 100644 --- a/assets/js/oauth.js +++ b/assets/js/oauth.js @@ -12,7 +12,7 @@ const redirectUri = `${window.location.origin}/` const sendPostRequest = async (url, params) => { const body = Object.keys(params) - .map(key => `${key}=${params[key]}`) + .map((key) => `${key}=${params[key]}`) .join("&") const options = { method: "post", @@ -38,11 +38,11 @@ const sendPostRequest = async (url, params) => { * @returns {Object} */ -const parseQueryString = searchQuery => { +const parseQueryString = (searchQuery) => { if (searchQuery === "") { return {} } - const segments = searchQuery.split("&").map(s => s.split("=")) + const segments = searchQuery.split("&").map((s) => s.split("=")) const queryString = segments.reduce((obj, el) => ({ ...obj, [el[0]]: el[1] }), {}) return queryString } @@ -53,7 +53,7 @@ const parseQueryString = searchQuery => { * @returns {Object} */ -const getTokenConfiguration = async endpoint => { +const getTokenConfiguration = async (endpoint) => { const options = { method: "GET", headers: { @@ -81,7 +81,7 @@ const getTokenConfiguration = async endpoint => { const generateRandomString = () => { const array = new Uint32Array(28) window.crypto.getRandomValues(array) - return Array.from(array, dec => `0${dec.toString(16)}`.substr(-2)).join("") + return Array.from(array, (dec) => `0${dec.toString(16)}`.substr(-2)).join("") } /** @@ -90,7 +90,7 @@ const generateRandomString = () => { * @returns {Promise} */ -const sha256 = plain => { +const sha256 = (plain) => { const encoder = new TextEncoder() const data = encoder.encode(plain) return window.crypto.subtle.digest("SHA-256", data) @@ -121,7 +121,7 @@ const base64urlencode = ( * @returns {String} */ -const pkceChallengeFromVerifier = async v => { +const pkceChallengeFromVerifier = async (v) => { const hashed = await sha256(v) return base64urlencode(hashed) } diff --git a/assets/js/pwa.js b/assets/js/pwa.js index cdecc3854..2ef76b641 100644 --- a/assets/js/pwa.js +++ b/assets/js/pwa.js @@ -18,7 +18,7 @@ export default () => { //*** If the PWA has not been installed, show the install PWA prompt.. ***// let deferredPrompt = null - window.addEventListener("beforeinstallprompt", event => { + window.addEventListener("beforeinstallprompt", (event) => { deferredPrompt = event // Show the install button if the prompt appeared. @@ -28,7 +28,7 @@ export default () => { }) // When the app is installed, remove install prompts. - window.addEventListener("appinstalled", event => { + window.addEventListener("appinstalled", (event) => { localStorage.setItem("pwaInstalled", "yes") pwaInstalled = true document.getElementById("installPWA").style.display = "none" diff --git a/components/collections/collection.vue b/components/collections/collection.vue index c59209826..a490f7a09 100644 --- a/components/collections/collection.vue +++ b/components/collections/collection.vue @@ -120,7 +120,7 @@ export default { this.$store.commit("postwoman/removeCollection", { collectionIndex: this.collectionIndex, }) - this.syncCollections(); + this.syncCollections() }, editFolder(collectionIndex, folder, folderIndex) { this.$emit("edit-folder", { collectionIndex, folder, folderIndex }) diff --git a/components/collections/editCollection.vue b/components/collections/editCollection.vue index 96c9bde52..a25b4d99f 100644 --- a/components/collections/editCollection.vue +++ b/components/collections/editCollection.vue @@ -80,8 +80,8 @@ export default { collection: collectionUpdated, collectionIndex: this.$props.editingCollectionIndex, }) - this.$emit("hide-modal"); - this.syncCollections(); + this.$emit("hide-modal") + this.syncCollections() }, hideModal() { this.$emit("hide-modal") diff --git a/components/collections/editFolder.vue b/components/collections/editFolder.vue index 0a161f903..38506700b 100644 --- a/components/collections/editFolder.vue +++ b/components/collections/editFolder.vue @@ -71,7 +71,7 @@ export default { folderIndex: this.$props.folderIndex, }) this.hideModal() - this.syncCollections(); + this.syncCollections() }, hideModal() { this.$emit("hide-modal") diff --git a/components/collections/editRequest.vue b/components/collections/editRequest.vue index b8bb99a4b..289c57005 100644 --- a/components/collections/editRequest.vue +++ b/components/collections/editRequest.vue @@ -139,7 +139,7 @@ export default { }) this.hideModal() - this.syncCollections(); + this.syncCollections() }, hideModal() { this.$emit("hide-modal") diff --git a/components/collections/folder.vue b/components/collections/folder.vue index 89e5c1ef5..8c652e9bb 100644 --- a/components/collections/folder.vue +++ b/components/collections/folder.vue @@ -106,7 +106,7 @@ export default { collectionIndex: this.collectionIndex, folderIndex: this.folderIndex, }) - this.syncCollections(); + this.syncCollections() }, editFolder() { this.$emit("edit-folder") diff --git a/components/collections/index.vue b/components/collections/index.vue index 77db8ad86..e7579c5d8 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -135,7 +135,8 @@ export default { computed: { collections() { return fb.currentUser !== null - ? fb.currentCollections : this.$store.state.postwoman.collections + ? fb.currentCollections + : this.$store.state.postwoman.collections }, }, async mounted() { diff --git a/components/collections/request.vue b/components/collections/request.vue index d55b8f59d..43eede7d0 100644 --- a/components/collections/request.vue +++ b/components/collections/request.vue @@ -69,7 +69,7 @@ export default { folderIndex: this.folderIndex, requestIndex: this.requestIndex, }) - this.syncCollections(); + this.syncCollections() }, }, } diff --git a/components/environments/index.vue b/components/environments/index.vue index e3f3af215..a17a9af5f 100644 --- a/components/environments/index.vue +++ b/components/environments/index.vue @@ -83,7 +83,8 @@ export default { computed: { environments() { return fb.currentUser !== null - ? fb.currentEnvironments : this.$store.state.postwoman.environments + ? fb.currentEnvironments + : this.$store.state.postwoman.environments }, }, async mounted() { diff --git a/components/firebase/logout.vue b/components/firebase/logout.vue index 4363a6385..2d7507330 100644 --- a/components/firebase/logout.vue +++ b/components/firebase/logout.vue @@ -24,7 +24,7 @@ export default { firebase .auth() .signOut() - .catch(err => { + .catch((err) => { self.$toast.show(err.message || err, { icon: "error", }) diff --git a/components/graphql/field.vue b/components/graphql/field.vue index 5200a1d3f..faee9fe98 100644 --- a/components/graphql/field.vue +++ b/components/graphql/field.vue @@ -38,7 +38,7 @@ display: inline-block; padding: 4px 8px; margin: 4px 0; - border-radius: 4px; + border-radius: 8px; font-size: 14px; font-weight: 700; } diff --git a/components/layout/header.vue b/components/layout/header.vue index 610e1d33a..9588fa161 100644 --- a/components/layout/header.vue +++ b/components/layout/header.vue @@ -113,14 +113,11 @@ {{ $t("tweet") }} - diff --git a/components/layout/logo.vue b/components/layout/logo.vue index ece25547c..29ded0081 100644 --- a/components/layout/logo.vue +++ b/components/layout/logo.vue @@ -5,7 +5,7 @@ x="0px" y="0px" viewBox="0 0 612.001 612.001" - style="enable-background:new 0 0 612.001 612.001;" + style="enable-background: new 0 0 612.001 612.001;" xml:space="preserve" > @@ -13,7 +13,7 @@ import("../../components/layout/section"), realtimeLog: () => import("./log"), }, - data: function() { + data: function () { return { url: "wss://test.mosquitto.org:8081", client: null, diff --git a/components/ui/ace-editor.vue b/components/ui/ace-editor.vue index 2b5140ddc..ce4303e04 100644 --- a/components/ui/ace-editor.vue +++ b/components/ui/ace-editor.vue @@ -120,7 +120,7 @@ export default { return this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME }, - provideLinting: debounce(function(code) { + provideLinting: debounce(function (code) { if (this.lang === "json") { try { jsonParse(code) diff --git a/components/ui/autocomplete.vue b/components/ui/autocomplete.vue index c2f64f619..534ce5b74 100644 --- a/components/ui/autocomplete.vue +++ b/components/ui/autocomplete.vue @@ -194,14 +194,14 @@ export default { return ( this.source - .filter(entry => { + .filter((entry) => { return ( entry.toLowerCase().startsWith(input.toLowerCase()) && input.toLowerCase() !== entry.toLowerCase() ) }) // Cut off the part that's already been typed. - .map(entry => entry.substring(this.selectionStart)) + .map((entry) => entry.substring(this.selectionStart)) // We only want the top 6 suggestions. .slice(0, 6) ) diff --git a/components/ui/modal.vue b/components/ui/modal.vue index 78b12c1b7..da6862d27 100644 --- a/components/ui/modal.vue +++ b/components/ui/modal.vue @@ -50,7 +50,7 @@ padding: 16px; transition: all 0.2s ease; background-color: var(--bg-color); - border-radius: 16px; + border-radius: 8px; box-shadow: 0px 16px 70px rgba(0, 0, 0, 0.5); max-height: calc(100vh - 128px); max-width: 720px; diff --git a/components/ui/tabs.vue b/components/ui/tabs.vue index 8c5af7f7f..63347b365 100644 --- a/components/ui/tabs.vue +++ b/components/ui/tabs.vue @@ -2,7 +2,7 @@