summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-08-31 15:21:41 +0200
committerGitHub <noreply@github.com>2021-08-31 15:21:41 +0200
commitbf078427d5bf60b65bd60d17e979511c5a28b8e4 (patch)
tree7324b5c5b0ffa9d5be1e87d377ea0e24a6f305ca
parent54d8059cc5945f6a1ef1b200481472ee684c4964 (diff)
parent5f20110113f42bcdd3c196ddaf96cba6183241e2 (diff)
Merge pull request #6171 from nextcloud/techdebt/noid/improve-eslint
Improve ESLint part 2
-rw-r--r--.eslintrc.js16
-rw-r--r--babel.config.js2
-rw-r--r--src/components/AdminSettings/Commands.vue1
-rw-r--r--src/components/AdminSettings/HostedSignalingServer.vue1
-rw-r--r--src/components/AdminSettings/MatterbridgeIntegration.vue2
-rw-r--r--src/components/AdminSettings/TurnServers.vue1
-rw-r--r--src/init.js2
-rw-r--r--src/services/conversationsService.js2
-rw-r--r--src/services/filesIntegrationServices.js2
-rw-r--r--src/services/messagesService.js6
-rw-r--r--src/services/participantsService.js2
-rw-r--r--src/store/callViewStore.js7
-rw-r--r--src/store/conversationsStore.js11
-rw-r--r--src/store/fileUploadStore.js58
-rw-r--r--src/store/guestNameStore.js24
-rw-r--r--src/store/messagesStore.js126
-rw-r--r--src/store/newGroupConversationStore.js4
-rw-r--r--src/store/participantsStore.js41
-rw-r--r--src/store/quoteReplyStore.js10
-rw-r--r--src/store/tokenStore.js10
-rw-r--r--src/store/uiModeStore.js4
-rw-r--r--src/utils/signaling.js8
-rw-r--r--src/utils/webrtc/MediaDevicesManager.js6
-rw-r--r--src/utils/webrtc/SentVideoQualityThrottler.js4
-rw-r--r--src/utils/webrtc/SpeakingWhileMutedWarner.js12
-rw-r--r--src/utils/webrtc/VideoConstrainer.js2
-rw-r--r--src/utils/webrtc/analyzers/CallAnalyzer.js10
-rw-r--r--src/utils/webrtc/index.js8
-rw-r--r--src/utils/webrtc/models/CallParticipantModel.js4
-rw-r--r--src/utils/webrtc/simplewebrtc/localmedia.js6
-rw-r--r--src/utils/webrtc/simplewebrtc/peer.js6
-rw-r--r--src/utils/webrtc/simplewebrtc/simplewebrtc.js2
-rw-r--r--src/utils/webrtc/simplewebrtc/webrtc.js2
-rw-r--r--src/utils/webrtc/webrtc.js65
34 files changed, 239 insertions, 228 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index bdeb502d9..2d21344cf 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,13 +1,13 @@
module.exports = {
extends: [
- '@nextcloud'
+ '@nextcloud',
],
overrides: [
{
- 'files': ['**/*.spec.js'],
- 'rules': {
- 'node/no-unpublished-import': 0
- }
- }
- ]
-} \ No newline at end of file
+ files: ['**/*.spec.js'],
+ rules: {
+ 'node/no-unpublished-import': 0,
+ },
+ },
+ ],
+}
diff --git a/babel.config.js b/babel.config.js
index bd8e2cb2b..8be4fc38b 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,3 +1,3 @@
const babelConfig = require('@nextcloud/babel-config')
-module.exports = babelConfig \ No newline at end of file
+module.exports = babelConfig
diff --git a/src/components/AdminSettings/Commands.vue b/src/components/AdminSettings/Commands.vue
index c3d4b22b2..c2ff5569e 100644
--- a/src/components/AdminSettings/Commands.vue
+++ b/src/components/AdminSettings/Commands.vue
@@ -30,6 +30,7 @@
</small>
</h2>
+ <!-- eslint-disable-next-line vue/no-v-html -->
<p class="settings-hint" v-html="commandHint" />
<div id="commands_list">
diff --git a/src/components/AdminSettings/HostedSignalingServer.vue b/src/components/AdminSettings/HostedSignalingServer.vue
index dac1499b7..c3d9a15bc 100644
--- a/src/components/AdminSettings/HostedSignalingServer.vue
+++ b/src/components/AdminSettings/HostedSignalingServer.vue
@@ -95,6 +95,7 @@
{{ requestError }}
</p>
+ <!-- eslint-disable-next-line vue/no-v-html -->
<p class="settings-hint additional-top-margin" v-html="disclaimerHint" />
</div>
<div v-else>
diff --git a/src/components/AdminSettings/MatterbridgeIntegration.vue b/src/components/AdminSettings/MatterbridgeIntegration.vue
index 81301f957..379c519f0 100644
--- a/src/components/AdminSettings/MatterbridgeIntegration.vue
+++ b/src/components/AdminSettings/MatterbridgeIntegration.vue
@@ -47,8 +47,10 @@
</template>
<template v-else>
+ <!-- eslint-disable-next-line vue/no-v-html -->
<p class="settings-hint" v-html="description" />
+ <!-- eslint-disable-next-line vue/no-v-html -->
<p class="settings-hint" v-html="customBinaryText" />
<p v-if="errorText" class="settings-hint">
diff --git a/src/components/AdminSettings/TurnServers.vue b/src/components/AdminSettings/TurnServers.vue
index 2dc9c6c66..a76806e9d 100644
--- a/src/components/AdminSettings/TurnServers.vue
+++ b/src/components/AdminSettings/TurnServers.vue
@@ -34,6 +34,7 @@
<span v-else class="icon icon-loading-small" />
</h2>
+ <!-- eslint-disable-next-line vue/no-v-html -->
<p class="settings-hint" v-html="documentationHint" />
<ul class="turn-servers">
diff --git a/src/init.js b/src/init.js
index e2789c323..0fe2418c6 100644
--- a/src/init.js
+++ b/src/init.js
@@ -33,7 +33,7 @@ if (!window.OCA.Talk) {
/**
* Frontend message API for adding actions to talk messages.
*
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {string} data.label the action label.
* @param {Function} data.callback the callback function. This function will receive
* the messageAPIData object as a parameter and be triggered by a click on the
diff --git a/src/services/conversationsService.js b/src/services/conversationsService.js
index 49cb4fb22..fffbb9005 100644
--- a/src/services/conversationsService.js
+++ b/src/services/conversationsService.js
@@ -62,7 +62,7 @@ const searchListedConversations = async function({ searchText }, options) {
/**
* Fetch possible conversations
*
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {string} data.searchText The string that will be used in the search query.
* @param {string} [data.token] The token of the conversation (if any), or "new" for a new one
* @param {boolean} [data.onlyUsers] Only return users
diff --git a/src/services/filesIntegrationServices.js b/src/services/filesIntegrationServices.js
index 64c7a4aec..8b4964359 100644
--- a/src/services/filesIntegrationServices.js
+++ b/src/services/filesIntegrationServices.js
@@ -26,7 +26,7 @@ import { generateOcsUrl } from '@nextcloud/router'
/**
* Gets the conversation token for a given file id
*
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {number} data.fileId The file id to get the conversation for
* @param {object} options unused
* @return {string} the conversation token
diff --git a/src/services/messagesService.js b/src/services/messagesService.js
index 849c881f0..f9d29a713 100644
--- a/src/services/messagesService.js
+++ b/src/services/messagesService.js
@@ -29,7 +29,7 @@ import Hex from 'crypto-js/enc-hex'
* Fetches messages that belong to a particular conversation
* specified with its token.
*
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {string} data.token the conversation token;
* @param {string} data.lastKnownMessageId last known message id;
* @param {boolean} data.includeLastKnown whether to include the last known message in the response;
@@ -50,7 +50,7 @@ const fetchMessages = async function({ token, lastKnownMessageId, includeLastKno
* Fetches newly created messages that belong to a particular conversation
* specified with its token.
*
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {number} data.lastKnownMessageId The id of the last message in the store.
* @param {string} data.token The conversation token;
* @param {object} options options
@@ -101,7 +101,7 @@ const deleteMessage = async function({ token, id }) {
* Post a rich object to a conversation
*
* @param {string} token conversation token
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {string} data.objectType object type
* @param {string} data.objectId object id
* @param {string} data.metaData JSON metadata of the rich object encoded as string
diff --git a/src/services/participantsService.js b/src/services/participantsService.js
index 3b50b54d8..286a4552f 100644
--- a/src/services/participantsService.js
+++ b/src/services/participantsService.js
@@ -33,7 +33,7 @@ import {
* Joins the current user to a conversation specified with
* the token.
*
- * @param {object} data the wrapping object.
+ * @param {object} data the wrapping object;
* @param {string} data.token The conversation token;
* @param {boolean} data.forceJoin whether to force join;
* @param {options} options request options;
diff --git a/src/store/callViewStore.js b/src/store/callViewStore.js
index 05d9b311b..c63f7488b 100644
--- a/src/store/callViewStore.js
+++ b/src/store/callViewStore.js
@@ -140,9 +140,10 @@ const actions = {
* If clearLast is false, also remembers it in separate properties.
*
* @param {object} context default store context;
- * @param {boolean|null} isGrid true for enabled grid mode, false for speaker view;
- * @param {boolean|null} isStripeOpen true for visible stripel mode, false for speaker view;
- * @param {boolean} clearLast set to false to not reset last temporary remembered state;
+ * @param {object} data the wrapping object;
+ * @param {boolean|null} data.isGrid true for enabled grid mode, false for speaker view;
+ * @param {boolean|null} data.isStripeOpen true for visible stripel mode, false for speaker view;
+ * @param {boolean} data.clearLast set to false to not reset last temporary remembered state;
*/
setCallViewMode(context, { isGrid = null, isStripeOpen = null, clearLast = true }) {
if (clearLast) {
diff --git a/src/store/conversationsStore.js b/src/store/conversationsStore.js
index 4bef78e5c..31a3caf3b 100644
--- a/src/store/conversationsStore.js
+++ b/src/store/conversationsStore.js
@@ -78,8 +78,7 @@ const getters = {
* Get a conversation providing it's token
*
* @param {object} state state object
- * @return {Function} The callback function
- * @return {object} The conversation object
+ * @return {Function} The callback function returning the conversation object
*/
conversation: state => token => state.conversations[token],
dummyConversation: state => Object.assign({}, DUMMY_CONVERSATION),
@@ -192,8 +191,8 @@ const actions = {
* Delete a conversation from the server.
*
* @param {object} context default store context;
- * @param token.token
- * @param {object} token the token of the conversation to be deleted;
+ * @param {object} data the wrapping object;
+ * @param {object} data.token the token of the conversation to be deleted;
*/
async deleteConversationFromServer(context, { token }) {
await deleteConversation(token)
@@ -205,8 +204,8 @@ const actions = {
* Delete all the messages from a conversation.
*
* @param {object} context default store context;
- * @param token.token
- * @param {object} token the token of the conversation whose history is
+ * @param {object} data the wrapping object;
+ * @param {object} data.token the token of the conversation whose history is
* to be cleared;
*/
async clearConversationHistory(context, { token }) {
diff --git a/src/store/fileUploadStore.js b/src/store/fileUploadStore.js
index 93ec22a6b..0cf8f7c40 100644
--- a/src/store/fileUploadStore.js
+++ b/src/store/fileUploadStore.js
@@ -189,12 +189,15 @@ const actions = {
/**
* Initialises uploads and shares files to a conversation
*
- * @param files.commit
- * @param files.dispatch
- * @param {object} files the files to be processed
- * @param {string} token the conversation's token where to share the files
- * @param {number} uploadId a unique id for the upload operation indexing
- * @param {boolean} rename whether to rename the files (usually after pasting)
+ * @param {object} context the wrapping object.
+ * @param {Function} context.commit the contexts commit function.
+ * @param {Function} context.dispatch the contexts dispatch function.
+ * @param {object} data the wrapping object;
+ * @param {object} data.files the files to be processed
+ * @param {string} data.token the conversation's token where to share the files
+ * @param {number} data.uploadId a unique id for the upload operation indexing
+ * @param {boolean} data.rename whether to rename the files (usually after pasting)
+ * @param {boolean} data.isVoiceMessage whether the file is a voice recording
*/
async initialiseUpload({ commit, dispatch }, { uploadId, token, files, rename = false, isVoiceMessage }) {
// Set last upload id
@@ -233,13 +236,12 @@ const actions = {
/**
* Discards an upload
*
- * @param {object} param0 Commit and state
- * @param param0.commit
- * @param param0.state
+ * @param {object} context the wrapping object.
+ * @param {Function} context.commit the contexts commit function.
+ * @param {object} context.state the contexts state object.
* @param {object} uploadId The unique uploadId
- * @param param0.getters
*/
- discardUpload({ commit, state, getters }, uploadId) {
+ discardUpload({ commit, state }, uploadId) {
if (state.currentUploadId === uploadId) {
commit('setCurrentUploadId', undefined)
}
@@ -250,12 +252,12 @@ const actions = {
/**
* Uploads the files to the root directory of the user
*
- * @param {object} param0 Commit, state and getters
- * @param param0.commit
- * @param param0.dispatch
- * @param {object} uploadId The unique uploadId
- * @param param0.state
- * @param param0.getters
+ * @param {object} context the wrapping object.
+ * @param {Function} context.commit the contexts commit function.
+ * @param {Function} context.dispatch the contexts dispatch function.
+ * @param {object} context.getters the contexts getters object.
+ * @param {object} context.state the contexts state object.
+ * @param {string} uploadId The unique uploadId
*/
async uploadFiles({ commit, dispatch, state, getters }, uploadId) {
if (state.currentUploadId === uploadId) {
@@ -366,12 +368,12 @@ const actions = {
/**
* Mark a file as shared
*
- * @param {object} context default store context;
- * @param {object} param1 The unique upload id original file index
- * @param context.commit
- * @param context.state
- * @param param1.uploadId
- * @param param1.index
+ * @param {object} context the wrapping object.
+ * @param {Function} context.commit the contexts commit function.
+ * @param {object} context.state the contexts state object.
+ * @param {object} data the wrapping object;
+ * @param {string} data.uploadId The id of the upload process
+ * @param {number} data.index The object index inside the upload process
* @throws {Error} when the item is already being shared by another async call
*/
markFileAsSharing({ commit, state }, { uploadId, index }) {
@@ -385,9 +387,9 @@ const actions = {
* Mark a file as shared
*
* @param {object} context default store context;
- * @param {object} param1 The unique upload id original file index
- * @param param1.uploadId
- * @param param1.index
+ * @param {object} data the wrapping object;
+ * @param {string} data.uploadId The id of the upload process
+ * @param {number} data.index The object index inside the upload process
*/
markFileAsShared(context, { uploadId, index }) {
context.commit('markFileAsShared', { uploadId, index })
@@ -396,8 +398,8 @@ const actions = {
/**
* Mark a file as shared
*
- * @param {object} context default store context;
- * @param context.commit
+ * @param {object} context the wrapping object.
+ * @param {Function} context.commit the contexts commit function.
* @param {string} temporaryMessageId message id of the temporary message associated to the file to remove
*/
removeFileFromSelection({ commit }, temporaryMessageId) {
diff --git a/src/store/guestNameStore.js b/src/store/guestNameStore.js
index 88675e903..94f39acc5 100644
--- a/src/store/guestNameStore.js
+++ b/src/store/guestNameStore.js
@@ -46,10 +46,11 @@ const mutations = {
* Adds a guest name to the store
*
* @param {object} state current store state
- * @param {boolean} noUpdate Only set the guest name if it was not set before
- * @param {string} token the token of the conversation
- * @param {string} actorId the guest
- * @param {string} actorDisplayName the display name to set
+ * @param {object} data the wrapping object;
+ * @param {boolean} data.noUpdate Only set the guest name if it was not set before
+ * @param {string} data.token the token of the conversation
+ * @param {string} data.actorId the guest
+ * @param {string} data.actorDisplayName the display name to set
*/
addGuestName(state, { noUpdate, token, actorId, actorDisplayName }) {
if (!state.guestNames[token]) {
@@ -70,20 +71,23 @@ const actions = {
* Add guest name of a chat message to the store
*
* @param {object} context default store context
- * @param {string} token the token of the conversation
- * @param {string} actorId the guest
- * @param {string} actorDisplayName the display name to set
+ * @param {object} data the wrapping object;
+ * @param {string} data.token the token of the conversation
+ * @param {string} data.actorId the guest
+ * @param {string} data.actorDisplayName the display name to set
*/
setGuestNameIfEmpty(context, { token, actorId, actorDisplayName }) {
context.commit('addGuestName', { noUpdate: true, token, actorId, actorDisplayName })
},
+