From bc4f8250bb19131f65eefb1f73d16761fc9d84df Mon Sep 17 00:00:00 2001 From: Milos Stojanovic Date: Tue, 25 Jun 2019 18:47:58 +0200 Subject: [PATCH] vue linter --- .eslintrc.js | 5 +- .travis.yml | 2 + frontend/App.vue | 8 +- frontend/views/Browser.vue | 227 ++++++++++++------------- frontend/views/Login.vue | 10 +- frontend/views/Users.vue | 73 ++++---- frontend/views/partials/Menu.vue | 19 +-- frontend/views/partials/Pagination.vue | 20 ++- frontend/views/partials/Profile.vue | 16 +- frontend/views/partials/Tree.vue | 10 +- frontend/views/partials/TreeNode.vue | 14 +- frontend/views/partials/Upload.vue | 28 +-- frontend/views/partials/UserEdit.vue | 36 ++-- 13 files changed, 243 insertions(+), 225 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7e5241d..1a3f86b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,12 +1,13 @@ module.exports = { extends: [ // add more generic rulesets here, such as: + 'eslint:recommended', 'plugin:vue/recommended' ], rules: { // override/add rules settings here, such as: - 'vue/no-unused-vars': 'error', + 'no-unused-vars': 'error', 'vue/require-prop-types': 0, - 'vue/require-default-prop': 0 + 'vue/max-attributes-per-line': 10 } } diff --git a/.travis.yml b/.travis.yml index 43c20ef..f867e1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,11 @@ before_script: - cp configuration_sample.php configuration.php - composer self-update - composer install --no-interaction + - npm install script: - vendor/bin/phpunit --coverage-clover=coverage.xml + - npm run lint after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/frontend/App.vue b/frontend/App.vue index 3790eb2..7bf127a 100644 --- a/frontend/App.vue +++ b/frontend/App.vue @@ -1,8 +1,8 @@ diff --git a/frontend/views/Browser.vue b/frontend/views/Browser.vue index 6c1357a..ae3dd5e 100644 --- a/frontend/views/Browser.vue +++ b/frontend/views/Browser.vue @@ -1,23 +1,21 @@ diff --git a/frontend/views/partials/Pagination.vue b/frontend/views/partials/Pagination.vue index 8c1fdd4..3bd0773 100644 --- a/frontend/views/partials/Pagination.vue +++ b/frontend/views/partials/Pagination.vue @@ -1,11 +1,19 @@ diff --git a/frontend/views/partials/Profile.vue b/frontend/views/partials/Profile.vue index 270c35f..8f088d2 100644 --- a/frontend/views/partials/Profile.vue +++ b/frontend/views/partials/Profile.vue @@ -1,22 +1,28 @@ diff --git a/frontend/views/partials/Tree.vue b/frontend/views/partials/Tree.vue index 2ab8407..9c0a1bf 100644 --- a/frontend/views/partials/Tree.vue +++ b/frontend/views/partials/Tree.vue @@ -1,17 +1,21 @@ diff --git a/frontend/views/partials/TreeNode.vue b/frontend/views/partials/TreeNode.vue index 1ce9950..1c5b925 100644 --- a/frontend/views/partials/TreeNode.vue +++ b/frontend/views/partials/TreeNode.vue @@ -6,7 +6,7 @@   {{ node.name }} @@ -26,12 +26,6 @@ export default { button_type: 'is-primary' } }, - mounted() { - if (this.node.path == '/') { - this.$store.commit('resetTree') - this.toggleButton(this.node) - } - }, computed: { icon() { return { @@ -42,6 +36,12 @@ export default { } }, }, + mounted() { + if (this.node.path == '/') { + this.$store.commit('resetTree') + this.toggleButton(this.node) + } + }, methods: { toggleButton(node) { if (! this.active) { diff --git a/frontend/views/partials/Upload.vue b/frontend/views/partials/Upload.vue index c4a2896..3216fcd 100644 --- a/frontend/views/partials/Upload.vue +++ b/frontend/views/partials/Upload.vue @@ -6,7 +6,7 @@
- + {{ lang('Uploading files', Math.round(resumable.progress()*100), formatBytes(resumable.getSize())) }} @@ -20,10 +20,10 @@
@@ -34,12 +34,12 @@
{{ file.relativePath != '/' ? file.relativePath : '' }}/{{ file.fileName }}
@@ -69,6 +69,11 @@ export default { progress: 0, } }, + computed: { + activeUploads() { + return this.resumable.files.length && this.resumable.progress() < 1 + }, + }, watch: { 'files' (files) { this.visible = true @@ -132,11 +137,6 @@ export default { file.file.uploadingError = true }) }, - computed: { - activeUploads() { - return this.resumable.files.length && this.resumable.progress() < 1 - }, - }, methods: { closeWindow() { if (this.activeUploads) { diff --git a/frontend/views/partials/UserEdit.vue b/frontend/views/partials/UserEdit.vue index 5765bd8..4c9eab3 100644 --- a/frontend/views/partials/UserEdit.vue +++ b/frontend/views/partials/UserEdit.vue @@ -1,36 +1,39 @@ @@ -73,8 +79,6 @@ import _ from 'lodash' export default { name: 'UserEdit', props: [ 'user', 'action' ], - computed: { - }, data() { return { formFields: { @@ -95,6 +99,8 @@ export default { } } }, + computed: { + }, watch: { 'permissions.read' (val) { if (!val) {