Browse Source

chores: Lint + dependency update

Liyas Thomas 4 years ago
parent
commit
7e1e61f8af

+ 4 - 1
components/collections/import-export-collections.vue

@@ -323,7 +323,10 @@ export default {
       return Object.prototype.hasOwnProperty.call(item, "item")
     },
     isSubFolder(item) {
-      return Object.prototype.hasOwnProperty.call(item, "_postman_isSubFolder") && item._postman_isSubFolder
+      return (
+        Object.prototype.hasOwnProperty.call(item, "_postman_isSubFolder") &&
+        item._postman_isSubFolder
+      )
     },
     flattenPostmanItem(subFolder, subFolderGlue = " -- ") {
       delete subFolder._postman_isSubFolder

+ 8 - 12
components/realtime/socketio.vue

@@ -14,14 +14,10 @@
           />
         </li>
         <div>
-        <li>
-          <label for="socketio-path">{{ $t("path") }}</label>
-          <input
-            id="socketio-path"
-            spellcheck="false"
-            v-model="path"
-          />
-        </li>
+          <li>
+            <label for="socketio-path">{{ $t("path") }}</label>
+            <input id="socketio-path" spellcheck="false" v-model="path" />
+          </li>
         </div>
         <div>
           <li>
@@ -125,11 +121,11 @@ export default {
       ]
 
       try {
-        if(!this.path){
-          this.path = '/socket.io'
+        if (!this.path) {
+          this.path = "/socket.io"
         }
-        this.io = new io(this.url,{
-          path: this.path
+        this.io = new io(this.url, {
+          path: this.path,
         })
         // Add ability to listen to all events
         wildcard(io.Manager)(this.io)

+ 4 - 4
components/ui/__tests__/autocomplete.spec.js

@@ -89,7 +89,7 @@ describe("autocomplete", () => {
     await selectedSuggestion.trigger("click")
     await wrapper.vm.$nextTick()
 
-    expect(input.element.value).toEqual("b" + selectedText)
+    expect(input.element.value).toEqual(`b${selectedText}`)
   })
 
   test("hide selection on pressing ESC", async () => {
@@ -255,7 +255,7 @@ describe("autocomplete", () => {
     })
     await wrapper.vm.$nextTick()
 
-    expect(input.element.value).toEqual("a" + selectedSuggestion)
+    expect(input.element.value).toEqual(`a${selectedSuggestion}`)
   })
 
   test("pressing tab when nothing is selected selects the first suggestion", async () => {
@@ -272,7 +272,7 @@ describe("autocomplete", () => {
     })
     await wrapper.vm.$nextTick()
 
-    expect(input.element.value).toEqual("a" + firstSuggestionText)
+    expect(input.element.value).toEqual(`a${firstSuggestionText}`)
   })
 
   test("pressing any non-special key doesn't do anything", async () => {
@@ -294,6 +294,6 @@ describe("autocomplete", () => {
     })
     await wrapper.vm.$nextTick()
 
-    expect(input.element.value).toEqual("a" + selectedSuggestion)
+    expect(input.element.value).toEqual(`a${selectedSuggestion}`)
   })
 })

+ 8 - 4
components/ui/url-field.vue

@@ -1,20 +1,24 @@
 <template>
   <div contenteditable class="url-field" ref="editor" spellcheck="false"></div>
 </template>
+
 <style lang="scss">
 .highlight-VAR {
   @apply font-bold;
-  color: var(--ac-color);
+  @apply text-acColor;
 }
+
 .highlight-TEXT {
   @apply overflow-auto;
   @apply break-all;
-  height: 20px;
+  height: 22px;
 }
+
 .highlight-TEXT::-webkit-scrollbar {
   @apply hidden;
 }
 </style>
+
 <script>
 export default {
   props: {
@@ -81,9 +85,9 @@ export default {
 
       return map
     },
-    getTextSegments(element) {
+    getTextSegments({ childNodes }) {
       const textSegments = []
-      Array.from(element.childNodes).forEach((node) => {
+      Array.from(childNodes).forEach((node) => {
         switch (node.nodeType) {
           case Node.TEXT_NODE:
             textSegments.push({ text: node.nodeValue, node })

+ 2 - 2
functions/package.json

@@ -13,10 +13,10 @@
   },
   "dependencies": {
     "firebase-admin": "^9.2.0",
-    "firebase-functions": "^3.9.1"
+    "firebase-functions": "^3.11.0"
   },
   "devDependencies": {
-    "firebase-functions-test": "^0.2.1"
+    "firebase-functions-test": "^0.2.2"
   },
   "private": true
 }

+ 12 - 16
helpers/__tests__/network.spec.js

@@ -6,22 +6,18 @@ import ExtensionStrategy, {
   hasExtensionInstalled,
 } from "../strategies/ExtensionStrategy"
 
-jest.mock("../strategies/AxiosStrategy", () => {
-  return {
-    __esModule: true,
-    default: jest.fn(() => Promise.resolve()),
-    cancelRunningAxiosRequest: jest.fn(() => Promise.resolve()),
-  }
-})
-
-jest.mock("../strategies/ExtensionStrategy", () => {
-  return {
-    __esModule: true,
-    default: jest.fn(() => Promise.resolve()),
-    cancelRunningExtensionRequest: jest.fn(() => Promise.resolve()),
-    hasExtensionInstalled: jest.fn(),
-  }
-})
+jest.mock("../strategies/AxiosStrategy", () => ({
+  __esModule: true,
+  default: jest.fn(() => Promise.resolve()),
+  cancelRunningAxiosRequest: jest.fn(() => Promise.resolve()),
+}))
+
+jest.mock("../strategies/ExtensionStrategy", () => ({
+  __esModule: true,
+  default: jest.fn(() => Promise.resolve()),
+  cancelRunningExtensionRequest: jest.fn(() => Promise.resolve()),
+  hasExtensionInstalled: jest.fn(),
+}))
 
 const extensionAllowedStore = {
   state: {

+ 1 - 1
helpers/codegen/codegen.js

@@ -14,7 +14,7 @@ export const codegens = [JSXHRCodegen, JSFetchCodegen, CurlCodegen]
 
 export function generateCodeWithGenerator(codegenID, context) {
   if (codegenID) {
-    const gen = codegens.find((e) => e.id === codegenID)
+    const gen = codegens.find(({ id }) => id === codegenID)
     return gen ? gen.generator(context) : ""
   }
 

+ 4 - 4
helpers/lenses/__tests__/lenses.spec.js

@@ -21,7 +21,7 @@ describe("getSuitableLenses", () => {
   })
 
   lenses
-    .filter((e) => e.lensName != rawLens.lensName)
+    .filter(({ lensName }) => lensName != rawLens.lensName)
     .forEach((el) => {
       test(`returns ${el.lensName} lens for its content-types`, () => {
         el.supportedContentTypes.forEach((contentType) => {
@@ -53,9 +53,9 @@ describe("getLensRenderers", () => {
   test("returns all the lens renderers", () => {
     const res = getLensRenderers()
 
-    lenses.forEach((lens) => {
-      expect(res).toHaveProperty(lens.renderer)
-      expect(res[lens.renderer]).toBe(lens.rendererImport)
+    lenses.forEach(({ renderer, rendererImport }) => {
+      expect(res).toHaveProperty(renderer)
+      expect(res[renderer]).toBe(rendererImport)
     })
   })
 })

+ 4 - 6
helpers/strategies/__tests__/AxiosStrategy-Proxy.spec.js

@@ -1,12 +1,10 @@
 import axios from "axios"
 import axiosStrategy, { testables, cancelRunningAxiosRequest } from "../AxiosStrategy"
 
-jest.mock("../../utils/b64", () => {
-  return {
-    __esModule: true,
-    decodeB64StringToArrayBuffer: jest.fn((data) => data + "-converted"),
-  }
-})
+jest.mock("../../utils/b64", () => ({
+  __esModule: true,
+  decodeB64StringToArrayBuffer: jest.fn((data) => `${data}-converted`),
+}))
 
 describe("cancelRunningAxiosRequest", () => {
   test("cancels axios request and does that only 1 time", () => {

+ 4 - 6
helpers/strategies/__tests__/ExtensionStrategy.spec.js

@@ -5,12 +5,10 @@ import extensionStrategy, {
   cancelRunningExtensionRequest,
 } from "../ExtensionStrategy"
 
-jest.mock("../../utils/b64", () => {
-  return {
-    __esModule: true,
-    decodeB64StringToArrayBuffer: jest.fn((data) => data + "-converted"),
-  }
-})
+jest.mock("../../utils/b64", () => ({
+  __esModule: true,
+  decodeB64StringToArrayBuffer: jest.fn((data) => `${data}-converted`),
+}))
 
 describe("hasExtensionInstalled", () => {
   test("returns true if extension is present and hooked", () => {

Some files were not shown because too many files changed in this diff