From 010be95ed5ffb4bbbbaa11eba614f45b6cdc3419 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Sun, 23 Feb 2020 22:43:12 +0530 Subject: [PATCH] Lint + few best practices --- components/environments/addEnvironment.vue | 11 ++-- components/environments/editEnvironment.vue | 50 +++++++++++-------- .../environments/importExportEnvironment.vue | 6 +-- components/environments/index.vue | 23 ++++++--- store/postwoman.js | 19 ++++--- 5 files changed, 63 insertions(+), 46 deletions(-) diff --git a/components/environments/addEnvironment.vue b/components/environments/addEnvironment.vue index b68768213..23c53d1ac 100644 --- a/components/environments/addEnvironment.vue +++ b/components/environments/addEnvironment.vue @@ -43,7 +43,6 @@ diff --git a/store/postwoman.js b/store/postwoman.js index 951cf4027..afffa7528 100644 --- a/store/postwoman.js +++ b/store/postwoman.js @@ -110,11 +110,11 @@ export const mutations = { }, removeVariables({ editingEnvironment }, value) { - editingEnvironment.variables = value + editingEnvironment.variables = value; }, - setEditingEnvironment(state, value ) { - state.editingEnvironment = {...value} + setEditingEnvironment(state, value) { + state.editingEnvironment = { ...value }; }, setVariableKey({ editingEnvironment }, { index, value }) { @@ -154,9 +154,11 @@ export const mutations = { saveEnvironment({ environments }, payload) { const { environment, environmentIndex } = payload; const { name } = environment; - const duplicateEnvironment = environments.some(item => { - return item.environmentIndex !== environmentIndex && item.name.toLowerCase() === name.toLowerCase() - }); + const duplicateEnvironment = environments.some( + item => + item.environmentIndex !== environmentIndex && + item.name.toLowerCase() === name.toLowerCase() + ); if (duplicateEnvironment) { this.$toast.info("Duplicate environment"); return; @@ -201,7 +203,10 @@ export const mutations = { }, editCollection({ collections }, payload) { - const { collection: { name }, collectionIndex } = payload; + const { + collection: { name }, + collectionIndex + } = payload; const duplicateCollection = collections.some( item => item.name.toLowerCase() === name.toLowerCase() );