From 5d9bb5e2471b5266496a1bfd0af11e766de917c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 17 Mar 2021 08:25:31 +0100 Subject: [PATCH] Lint fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .eslintignore | 3 +- apps/comments/src/comments.js | 1 - apps/comments/src/templates.js | 123 ------------------ apps/dashboard/webpack.js | 4 +- apps/files/src/templates.js | 1 - apps/files/webpack.js | 6 +- apps/files_external/tests/appSpec.js | 98 +++++++------- .../src/collaborationresources.js | 2 +- .../src/components/SharingEntry.vue | 2 +- .../src/views/CollaborationView.vue | 6 +- apps/files_sharing/webpack.js | 16 +-- apps/files_trashbin/webpack.js | 4 +- apps/files_versions/webpack.js | 4 +- apps/oauth2/src/App.vue | 4 +- apps/oauth2/webpack.js | 4 +- apps/settings/src/components/popoverMenu.vue | 40 ------ apps/systemtags/webpack.js | 4 +- apps/twofactor_backupcodes/webpack.js | 4 +- .../src/components/UpdateNotification.vue | 2 +- apps/updatenotification/webpack.js | 4 +- apps/weather_status/webpack.js | 18 +-- apps/workflowengine/webpack.js | 6 +- core/src/tests/.eslintrc.js | 9 ++ core/src/tests/OC/requesttoken.spec.js | 10 +- core/src/tests/setup.js | 4 +- core/src/views/Login.vue | 4 +- core/webpack.js | 2 +- core/webpack.test.js | 6 +- webpack.common.js | 4 +- webpack.dev.js | 4 +- webpack.prod.js | 2 +- 31 files changed, 122 insertions(+), 279 deletions(-) delete mode 100644 apps/comments/src/templates.js delete mode 100644 apps/settings/src/components/popoverMenu.vue create mode 100644 core/src/tests/.eslintrc.js diff --git a/.eslintignore b/.eslintignore index 6dddc5380b8..f8d8b5a2bc4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,4 +4,5 @@ node_modules/ **/vendor/ **/l10n/ **/js/* -*.config.js \ No newline at end of file +*.config.js +tests/lib/ diff --git a/apps/comments/src/comments.js b/apps/comments/src/comments.js index 3d7f52f4e74..75bb97138c3 100644 --- a/apps/comments/src/comments.js +++ b/apps/comments/src/comments.js @@ -1,5 +1,4 @@ import './app' -import './templates' import './filesplugin' import './activitytabviewplugin' diff --git a/apps/comments/src/templates.js b/apps/comments/src/templates.js deleted file mode 100644 index 26ca658c772..00000000000 --- a/apps/comments/src/templates.js +++ /dev/null @@ -1,123 +0,0 @@ -(function() { - var template = Handlebars.template, templates = OCA.Comments.Templates = OCA.Comments.Templates || {}; -templates['comment'] = template({"1":function(container,depth0,helpers,partials,data) { - return " unread"; -},"3":function(container,depth0,helpers,partials,data) { - return " collapsed"; -},"5":function(container,depth0,helpers,partials,data) { - return " currentUser"; -},"7":function(container,depth0,helpers,partials,data) { - var helper; - - return "data-username=\"" - + container.escapeExpression(((helper = (helper = helpers.actorId || (depth0 != null ? depth0.actorId : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"actorId","hash":{},"data":data}) : helper))) - + "\""; -},"9":function(container,depth0,helpers,partials,data) { - return " \n
\n"; -},"11":function(container,depth0,helpers,partials,data) { - return "
\n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
  • \n
    \n
    \n
    " - + alias4(((helper = (helper = helpers.actorDisplayName || (depth0 != null ? depth0.actorDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"actorDisplayName","hash":{},"data":data}) : helper))) - + "
    \n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isUserAuthor : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    " - + alias4(((helper = (helper = helpers.date || (depth0 != null ? depth0.date : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"date","hash":{},"data":data}) : helper))) - + "
    \n
    \n
    " - + ((stack1 = ((helper = (helper = helpers.formattedMessage || (depth0 != null ? depth0.formattedMessage : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"formattedMessage","hash":{},"data":data}) : helper))) != null ? stack1 : "") - + "
    \n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLong : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
  • \n"; -},"useData":true}); -templates['commentsmodifymenu'] = template({"1":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "
  • \n \n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "") - + " " - + alias4(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data}) : helper))) - + "\n \n
  • \n"; -},"2":function(container,depth0,helpers,partials,data) { - var helper; - - return " \n"; -},"4":function(container,depth0,helpers,partials,data) { - return " \n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1; - - return "\n"; -},"useData":true}); -templates['edit_comment'] = template({"1":function(container,depth0,helpers,partials,data) { - var helper; - - return "
    \n \n
    \n"; -},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "<" - + alias4(((helper = (helper = helpers.tag || (depth0 != null ? depth0.tag : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tag","hash":{},"data":data}) : helper))) - + " class=\"newCommentRow comment\" data-id=\"" - + alias4(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data}) : helper))) - + "\">\n
    \n
    \n
    " - + alias4(((helper = (helper = helpers.actorDisplayName || (depth0 != null ? depth0.actorDisplayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"actorDisplayName","hash":{},"data":data}) : helper))) - + "
    \n" - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isEditMode : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") - + "
    \n
    \n
    " - + alias4(((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"message","hash":{},"data":data}) : helper))) - + "
    \n \n
    \n
    \n\n"; -},"useData":true}); -templates['filesplugin'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "\n \n\n"; -},"useData":true}); -templates['view'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - - return "\n
    \n

    " - + alias4(((helper = (helper = helpers.emptyResultLabel || (depth0 != null ? depth0.emptyResultLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"emptyResultLabel","hash":{},"data":data}) : helper))) - + "

    \n\n
    \n"; -},"useData":true}); -})(); \ No newline at end of file diff --git a/apps/dashboard/webpack.js b/apps/dashboard/webpack.js index ac455498920..f5ab624a9a9 100644 --- a/apps/dashboard/webpack.js +++ b/apps/dashboard/webpack.js @@ -6,6 +6,6 @@ module.exports = { path: path.resolve(__dirname, './js'), publicPath: '/js/', filename: 'dashboard.js', - jsonpFunction: 'webpackJsonpDashboard' - } + jsonpFunction: 'webpackJsonpDashboard', + }, } diff --git a/apps/files/src/templates.js b/apps/files/src/templates.js index be41e864854..ec219f2c91e 100644 --- a/apps/files/src/templates.js +++ b/apps/files/src/templates.js @@ -29,7 +29,6 @@ import axios from '@nextcloud/axios' import Vue from 'vue' import TemplatePickerView from './views/TemplatePicker' -import { getCurrentUser } from '@nextcloud/auth' import { showError } from '@nextcloud/dialogs' // Set up logger diff --git a/apps/files/webpack.js b/apps/files/webpack.js index 8dbbad5081f..e83f14ad4e7 100644 --- a/apps/files/webpack.js +++ b/apps/files/webpack.js @@ -1,4 +1,4 @@ -const path = require('path'); +const path = require('path') module.exports = { entry: { @@ -11,6 +11,6 @@ module.exports = { path: path.resolve(__dirname, './js/dist/'), publicPath: '/js/', filename: '[name].js', - chunkFilename: 'files.[id].js' - } + chunkFilename: 'files.[id].js', + }, } diff --git a/apps/files_external/tests/appSpec.js b/apps/files_external/tests/appSpec.js index a834d96e2c0..fa969f289f0 100644 --- a/apps/files_external/tests/appSpec.js +++ b/apps/files_external/tests/appSpec.js @@ -20,80 +20,80 @@ */ describe('OCA.Files_External.App tests', function() { - var App = OCA.Files_External.App; - var fileList; + const App = OCA.Files_External.App + let fileList beforeEach(function() { $('#testArea').append( - '
    ' + - '
    • Files
    • ' + - '
    • ' + - '
    • ' + - '
    ' + - '
    ' + - '' + - '' + - '
    ' + - '' - ); - fileList = App.initList($('#app-content-extstoragemounts')); - }); + '
    ' + + '
    • Files
    • ' + + '
    • ' + + '
    • ' + + '
    ' + + '
    ' + + '' + + '' + + '
    ' + + '' + ) + fileList = App.initList($('#app-content-extstoragemounts')) + }) afterEach(function() { - App.fileList = null; - fileList.destroy(); - fileList = null; - }); + App.fileList = null + fileList.destroy() + fileList = null + }) describe('initialization', function() { it('inits external mounts list on show', function() { - expect(App.fileList).toBeDefined(); - }); - }); + expect(App.fileList).toBeDefined() + }) + }) describe('file actions', function() { it('provides default file actions', function() { - var fileActions = fileList.fileActions; + const fileActions = fileList.fileActions - expect(fileActions.actions.all).toBeDefined(); - expect(fileActions.actions.all.Delete).toBeDefined(); - expect(fileActions.actions.all.Rename).toBeDefined(); - expect(fileActions.actions.all.Download).toBeDefined(); + expect(fileActions.actions.all).toBeDefined() + expect(fileActions.actions.all.Delete).toBeDefined() + expect(fileActions.actions.all.Rename).toBeDefined() + expect(fileActions.actions.all.Download).toBeDefined() - expect(fileActions.defaults.dir).toEqual('Open'); - }); + expect(fileActions.defaults.dir).toEqual('Open') + }) it('redirects to files app when opening a directory', function() { - var oldList = OCA.Files.App.fileList; + const oldList = OCA.Files.App.fileList // dummy new list to make sure it exists - OCA.Files.App.fileList = new OCA.Files.FileList($('
    ')); + OCA.Files.App.fileList = new OCA.Files.FileList($('
    ')) - var setActiveViewStub = sinon.stub(OCA.Files.App, 'setActiveView'); + const setActiveViewStub = sinon.stub(OCA.Files.App, 'setActiveView') // create dummy table so we can click the dom - var $table = '
    '; - $('#app-content-extstoragemounts').append($table); + const $table = '
    ' + $('#app-content-extstoragemounts').append($table) - App._inFileList = null; - fileList = App.initList($('#app-content-extstoragemounts')); + App._inFileList = null + fileList = App.initList($('#app-content-extstoragemounts')) fileList.setFiles([{ name: 'testdir', type: 'dir', path: '/somewhere/inside/subdir', counterParts: ['user2'], - shareOwner: 'user2' - }]); + shareOwner: 'user2', + }]) - fileList.findFileEl('testdir').find('td a.name').click(); + fileList.findFileEl('testdir').find('td a.name').click() - expect(OCA.Files.App.fileList.getCurrentDirectory()).toEqual('/somewhere/inside/subdir/testdir'); + expect(OCA.Files.App.fileList.getCurrentDirectory()).toEqual('/somewhere/inside/subdir/testdir') - expect(setActiveViewStub.calledOnce).toEqual(true); - expect(setActiveViewStub.calledWith('files')).toEqual(true); + expect(setActiveViewStub.calledOnce).toEqual(true) + expect(setActiveViewStub.calledWith('files')).toEqual(true) - setActiveViewStub.restore(); + setActiveViewStub.restore() // restore old list - OCA.Files.App.fileList = oldList; - }); - }); -}); + OCA.Files.App.fileList = oldList + }) + }) +}) diff --git a/apps/files_sharing/src/collaborationresources.js b/apps/files_sharing/src/collaborationresources.js index 68cea9e59d3..b724c6f93a4 100644 --- a/apps/files_sharing/src/collaborationresources.js +++ b/apps/files_sharing/src/collaborationresources.js @@ -39,5 +39,5 @@ Vue.use(Vuex) export { Vue, - View + View, } diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 4baafcd96bc..d31c7ef6e3f 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -30,8 +30,8 @@ :menu-position="'left'" :url="share.shareWithAvatar" />