aboutsummaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-06-25 00:00:31 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-09 17:13:30 +0200
commit691f570237e26398aa22f40c0efca23141d5583e (patch)
tree4409270ac8ee482ad03f745f77003c726ffbf09f /core/src
parent3a97dbf248b3e581b5782a638743958eb6f2a640 (diff)
downloadnextcloud-server-691f570237e26398aa22f40c0efca23141d5583e.tar.gz
nextcloud-server-691f570237e26398aa22f40c0efca23141d5583e.zip
chore: Enable ESLint for apps and fix all errors
Nevertheless this causes a huge amount of new warnings. Previously the shell script for directories to lint was wrong it was generating all app names to lint, but was missing the `apps/` prefix. Causing only `core` to be linted. Co-authored-by: Grigorii K. Shartsev <me@shgk.me> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/OC/menu.js2
-rw-r--r--core/src/OC/notification.js8
-rw-r--r--core/src/OC/util-history.js2
-rw-r--r--core/src/OC/xhr-error.js2
-rw-r--r--core/src/Util/get-url-parameter.js2
-rw-r--r--core/src/components/ContactsMenu/Contact.vue2
-rw-r--r--core/src/components/setup/RecommendedApps.vue2
-rw-r--r--core/src/jquery/octemplate.js2
-rw-r--r--core/src/session-heartbeat.js4
-rw-r--r--core/src/systemtags/systemtagmodel.js1
-rw-r--r--core/src/tests/components/ContactsMenu/Contact.spec.js6
-rw-r--r--core/src/tests/views/ContactsMenu.spec.js18
-rw-r--r--core/src/utils/xhr-request.js2
-rw-r--r--core/src/views/ContactsMenu.vue6
14 files changed, 30 insertions, 29 deletions
diff --git a/core/src/OC/menu.js b/core/src/OC/menu.js
index 87ec5327047..4b4eb658592 100644
--- a/core/src/OC/menu.js
+++ b/core/src/OC/menu.js
@@ -104,7 +104,7 @@ export const hideMenus = function(complete) {
/**
* Shows a given element as menu
*
- * @param {object} [$toggle=null] menu toggle
+ * @param {object} [$toggle] menu toggle
* @param {object} $menuEl menu element
* @param {Function} complete callback when the showing animation is done
*/
diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js
index 817620e9634..7f95f8335f4 100644
--- a/core/src/OC/notification.js
+++ b/core/src/OC/notification.js
@@ -76,7 +76,7 @@ export default {
* @param {string} html Message to display
* @param {object} [options] options
* @param {string} [options.type] notification type
- * @param {number} [options.timeout=0] timeout value, defaults to 0 (permanent)
+ * @param {number} [options.timeout] timeout value, defaults to 0 (permanent)
* @return {jQuery} jQuery element for notification row
* @deprecated 17.0.0 use the `@nextcloud/dialogs` package
*/
@@ -95,7 +95,7 @@ export default {
* @param {string} text Message to display
* @param {object} [options] options
* @param {string} [options.type] notification type
- * @param {number} [options.timeout=0] timeout value, defaults to 0 (permanent)
+ * @param {number} [options.timeout] timeout value, defaults to 0 (permanent)
* @return {jQuery} jQuery element for notification row
* @deprecated 17.0.0 use the `@nextcloud/dialogs` package
*/
@@ -138,8 +138,8 @@ export default {
*
* @param {string} text Message to show
* @param {Array} [options] options array
- * @param {number} [options.timeout=7] timeout in seconds, if this is 0 it will show the message permanently
- * @param {boolean} [options.isHTML=false] an indicator for HTML notifications (true) or text (false)
+ * @param {number} [options.timeout] timeout in seconds, if this is 0 it will show the message permanently
+ * @param {boolean} [options.isHTML] an indicator for HTML notifications (true) or text (false)
* @param {string} [options.type] notification type
* @return {JQuery} the toast element
* @deprecated 17.0.0 use the `@nextcloud/dialogs` package
diff --git a/core/src/OC/util-history.js b/core/src/OC/util-history.js
index eb4ddb185c8..7ecd0e098c6 100644
--- a/core/src/OC/util-history.js
+++ b/core/src/OC/util-history.js
@@ -27,7 +27,7 @@ export default {
* or a map
* @param {string} [url] URL to be used, otherwise the current URL will be used,
* using the params as query string
- * @param {boolean} [replace=false] whether to replace instead of pushing
+ * @param {boolean} [replace] whether to replace instead of pushing
*/
_pushState(params, url, replace) {
let strParams
diff --git a/core/src/OC/xhr-error.js b/core/src/OC/xhr-error.js
index f7dda747e67..66ad638e10a 100644
--- a/core/src/OC/xhr-error.js
+++ b/core/src/OC/xhr-error.js
@@ -47,7 +47,7 @@ export const processAjaxError = xhr => {
OC.reload()
}
timer++
- }, 1000 // 1 second interval
+ }, 1000, // 1 second interval
)
// only call reload once
diff --git a/core/src/Util/get-url-parameter.js b/core/src/Util/get-url-parameter.js
index 52105f9c7fa..6df264f009f 100644
--- a/core/src/Util/get-url-parameter.js
+++ b/core/src/Util/get-url-parameter.js
@@ -9,6 +9,6 @@
export default function getURLParameter(name) {
return decodeURIComponent(
// eslint-disable-next-line no-sparse-arrays
- (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ''])[1].replace(/\+/g, '%20')
+ (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ''])[1].replace(/\+/g, '%20'),
) || ''
}
diff --git a/core/src/components/ContactsMenu/Contact.vue b/core/src/components/ContactsMenu/Contact.vue
index a9b1be9b6e6..e57c0d067db 100644
--- a/core/src/components/ContactsMenu/Contact.vue
+++ b/core/src/components/ContactsMenu/Contact.vue
@@ -78,7 +78,7 @@ export default {
}
}
return undefined
- }
+ },
},
}
</script>
diff --git a/core/src/components/setup/RecommendedApps.vue b/core/src/components/setup/RecommendedApps.vue
index 38127d99d44..99ee99dbe6c 100644
--- a/core/src/components/setup/RecommendedApps.vue
+++ b/core/src/components/setup/RecommendedApps.vue
@@ -111,7 +111,7 @@ export default {
loadingApps: true,
loadingAppsError: false,
apps: [],
- defaultPageUrl: loadState('core', 'defaultPageUrl')
+ defaultPageUrl: loadState('core', 'defaultPageUrl'),
}
},
computed: {
diff --git a/core/src/jquery/octemplate.js b/core/src/jquery/octemplate.js
index 8de0a9d9506..cecbe880aa6 100644
--- a/core/src/jquery/octemplate.js
+++ b/core/src/jquery/octemplate.js
@@ -89,7 +89,7 @@ const Template = {
function(a, b) {
const r = o[b]
return typeof r === 'string' || typeof r === 'number' ? r : a
- }
+ },
)
} catch (e) {
console.error(e, 'data:', data)
diff --git a/core/src/session-heartbeat.js b/core/src/session-heartbeat.js
index b9a7dd42098..3bd4d6b9ccd 100644
--- a/core/src/session-heartbeat.js
+++ b/core/src/session-heartbeat.js
@@ -52,8 +52,8 @@ const getInterval = () => {
24 * 3600,
Math.max(
60,
- isNaN(interval) ? 900 : interval
- )
+ isNaN(interval) ? 900 : interval,
+ ),
)
}
diff --git a/core/src/systemtags/systemtagmodel.js b/core/src/systemtags/systemtagmodel.js
index d2401954b67..349650e02be 100644
--- a/core/src/systemtags/systemtagmodel.js
+++ b/core/src/systemtags/systemtagmodel.js
@@ -2,6 +2,7 @@
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-or-later
+ * @param OC
*/
(function(OC) {
diff --git a/core/src/tests/components/ContactsMenu/Contact.spec.js b/core/src/tests/components/ContactsMenu/Contact.spec.js
index 77a6bee1e86..bf474505009 100644
--- a/core/src/tests/components/ContactsMenu/Contact.spec.js
+++ b/core/src/tests/components/ContactsMenu/Contact.spec.js
@@ -17,19 +17,19 @@ describe('Contact', function() {
topAction: {
title: 'Mail',
icon: 'icon-mail',
- hyperlink: 'mailto:deboraoliver%40centrexin.com'
+ hyperlink: 'mailto:deboraoliver%40centrexin.com',
},
emailAddresses: [],
actions: [
{
title: 'Mail',
icon: 'icon-mail',
- hyperlink: 'mailto:mathisholland%40virxo.com'
+ hyperlink: 'mailto:mathisholland%40virxo.com',
},
{
title: 'Details',
icon: 'icon-info',
- hyperlink: 'https://localhost/index.php/apps/contacts'
+ hyperlink: 'https://localhost/index.php/apps/contacts',
},
],
lastMessage: '',
diff --git a/core/src/tests/views/ContactsMenu.spec.js b/core/src/tests/views/ContactsMenu.spec.js
index c28d7226e79..6df73fa1827 100644
--- a/core/src/tests/views/ContactsMenu.spec.js
+++ b/core/src/tests/views/ContactsMenu.spec.js
@@ -82,19 +82,19 @@ describe('ContactsMenu', function() {
topAction: {
title: 'Mail',
icon: 'icon-mail',
- hyperlink: 'mailto:deboraoliver%40centrexin.com'
+ hyperlink: 'mailto:deboraoliver%40centrexin.com',
},
actions: [
{
title: 'Mail',
icon: 'icon-mail',
- hyperlink: 'mailto:mathisholland%40virxo.com'
+ hyperlink: 'mailto:mathisholland%40virxo.com',
},
{
title: 'Details',
icon: 'icon-info',
- hyperlink: 'https://localhost/index.php/apps/contacts'
- }
+ hyperlink: 'https://localhost/index.php/apps/contacts',
+ },
],
lastMessage: '',
emailAddresses: [],
@@ -105,23 +105,23 @@ describe('ContactsMenu', function() {
topAction: {
title: 'Mail',
icon: 'icon-mail',
- hyperlink: 'mailto:ceciliasoto%40essensia.com'
+ hyperlink: 'mailto:ceciliasoto%40essensia.com',
},
actions: [
{
title: 'Mail',
icon: 'icon-mail',
- hyperlink: 'mailto:pearliesellers%40inventure.com'
+ hyperlink: 'mailto:pearliesellers%40inventure.com',
},
{
title: 'Details',
icon: 'icon-info',
- hyperlink: 'https://localhost/index.php/apps/contacts'
- }
+ hyperlink: 'https://localhost/index.php/apps/contacts',
+ },
],
lastMessage: 'cu',
emailAddresses: [],
- }
+ },
],
contactsAppEnabled: true,
},
diff --git a/core/src/utils/xhr-request.js b/core/src/utils/xhr-request.js
index b991ae875cf..5eaeb7e64d7 100644
--- a/core/src/utils/xhr-request.js
+++ b/core/src/utils/xhr-request.js
@@ -8,7 +8,7 @@ import { getRootUrl } from '@nextcloud/router'
/**
*
* @param {string} url the URL to check
- * @returns {boolean}
+ * @return {boolean}
*/
const isRelativeUrl = (url) => {
return !url.startsWith('https://') && !url.startsWith('http://')
diff --git a/core/src/views/ContactsMenu.vue b/core/src/views/ContactsMenu.vue
index 51eea0a0fb1..17bb9d5725c 100644
--- a/core/src/views/ContactsMenu.vue
+++ b/core/src/views/ContactsMenu.vue
@@ -13,14 +13,14 @@
</template>
<div class="contactsmenu__menu">
<div class="contactsmenu__menu__input-wrapper">
- <NcTextField :value.sync="searchTerm"
- trailing-button-icon="close"
+ <NcTextField id="contactsmenu__menu__search"
ref="contactsMenuInput"
+ :value.sync="searchTerm"
+ trailing-button-icon="close"
:label="t('core', 'Search contacts')"
:trailing-button-label="t('core','Reset search')"
:show-trailing-button="searchTerm !== ''"
:placeholder="t('core', 'Search contacts …')"
- id="contactsmenu__menu__search"
class="contactsmenu__menu__search"
@input="onInputDebounced"
@trailing-button-click="onReset" />