From ed32a25bfea6125a1c4bb7eece4fa9ba16eaefd9 Mon Sep 17 00:00:00 2001 From: Shashwat Chandra Date: Sat, 9 Sep 2017 00:31:31 +0530 Subject: [PATCH] ESLint changes --- .eslintrc.js | 3 ++- src/js/folder_model.js | 9 ++++++--- src/js/router.js | 4 ++-- src/js/store/gistux.js | 9 +++++---- src/js/util/string.js | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b3b937e..d3f3028 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,7 @@ module.exports = { "__getScopedUrl", "_requestAllPages", "_props" ] - }] + }], + "import/prefer-default-export": [1, "always"] } }; diff --git a/src/js/folder_model.js b/src/js/folder_model.js index 0a43fc6..24b4f17 100644 --- a/src/js/folder_model.js +++ b/src/js/folder_model.js @@ -103,18 +103,21 @@ class FolderModel { folderNames (node) { return this.getFolders(node.parent).map((folder) => { - if (folder.model === node.model) + if (folder.model === node.model) { return null; + } return folder.model.name; }); } updateFolderName (node, name) { - if (!this.isFolder(node)) + if (!this.isFolder(node)) { return false; + } - if (this.folderNames(node).includes(name)) + if (this.folderNames(node).includes(name)) { return false; + } node.model.name = name; return true; diff --git a/src/js/router.js b/src/js/router.js index 8d9fee0..e0869cf 100644 --- a/src/js/router.js +++ b/src/js/router.js @@ -1,6 +1,6 @@ import Vue from 'vue'; -import store from './store'; import VueRouter from 'vue-router'; +import store from './store'; import List from './views/list.vue'; import Config from './views/config.vue'; @@ -21,7 +21,7 @@ const routes = [ } }, { - path: "/config", + path: '/config', component: Config } ]; diff --git a/src/js/store/gistux.js b/src/js/store/gistux.js index aa30519..c4483c3 100644 --- a/src/js/store/gistux.js +++ b/src/js/store/gistux.js @@ -54,13 +54,13 @@ export default { state.folderJSONChanged = true; }, addFolderToFolderJSON (state, payload) { - const {folderName, node} = payload; - let response = window.folderJSON.addFolder(folderName, node); + const { folderName, node } = payload; + const response = window.folderJSON.addFolder(folderName, node); state.folderJSONChanged = true; state.mutationReturnValue = response; }, folderJSONmoveFile (state, payload) { - const {fileNode, folder} = payload; + const { fileNode, folder } = payload; window.folderJSON.move(fileNode, folder); state.folderJSONChanged = true; }, @@ -72,8 +72,9 @@ export default { setGistData (context, data) { context.commit('setGistData', data); - if (context.getters.gistUXFileName === null) + if (context.getters.gistUXFileName === null) { throw new NotLoggedInException(); + } if (window.folderJSON.isEmpty()) { const folderJSONConfigFile = context.getters.folderJSONConfigFile; diff --git a/src/js/util/string.js b/src/js/util/string.js index 8c2bf78..190e8ae 100644 --- a/src/js/util/string.js +++ b/src/js/util/string.js @@ -1,3 +1,3 @@ export function objectEqual (obj1, obj2) { - return JSON.stringify(obj1) === JSON.stringify(obj2) + return JSON.stringify(obj1) === JSON.stringify(obj2); }