From 3641364d31a9b965f117d231441f8abf52cdc57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 28 Jun 2023 09:16:11 +0200 Subject: [PATCH] style(eslint): Fix eslint warnings/errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/share.spec.js | 1 - cypress/support/chai.js | 2 +- cypress/support/commands.js | 18 +++++++++--------- src/components/Editor/MediaHandler.vue | 4 ++-- src/components/Editor/SessionList.vue | 2 +- src/components/Editor/Wrapper.vue | 2 +- src/components/Menu/ActionInsertLink.vue | 2 +- src/extensions/Markdown.js | 4 ++-- src/helpers/files.js | 2 +- src/markdownit/keepSyntax.js | 2 +- src/nodes/BulletList.js | 2 +- src/nodes/Table/Table.js | 4 ++-- src/services/AttachmentResolver.js | 2 +- src/services/SyncServiceProvider.js | 2 +- 14 files changed, 24 insertions(+), 25 deletions(-) diff --git a/cypress/e2e/share.spec.js b/cypress/e2e/share.spec.js index b285cedcb38..3d53f75e424 100644 --- a/cypress/e2e/share.spec.js +++ b/cypress/e2e/share.spec.js @@ -1,4 +1,3 @@ - /** * @copyright Copyright (c) 2020 Julius Härtl * diff --git a/cypress/support/chai.js b/cypress/support/chai.js index 77737e3bce2..539728af036 100644 --- a/cypress/support/chai.js +++ b/cypress/support/chai.js @@ -10,7 +10,7 @@ export default _chai => { rect.top < height && rect.bottom > 0 && rect.right <= width && rect.left >= 0, 'expected #{this} to be in the viewport', 'expected #{this} to not be in the viewport', - this._obj + this._obj, ) }) } diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 9d1276d7edd..db483c64a96 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -84,11 +84,11 @@ Cypress.Commands.add('uploadFile', (fileName, mimeType, target) => { }) }).then(response => { const fileId = Number( - response.headers['oc-fileid']?.split('oc')?.[0] + response.headers['oc-fileid']?.split('oc')?.[0], ) cy.log(`Uploaded ${fileName}`, response.status, - { fileId } + { fileId }, ) return cy.wrap(fileId) }) @@ -194,7 +194,7 @@ Cypress.Commands.add('shareFile', (path, options = {}) => { const request = await axios.post( `${url}/ocs/v2.php/apps/files_sharing/api/v1/shares`, { path, shareType }, - { headers } + { headers }, ) const token = request.data?.ocs?.data?.token const id = request.data?.ocs?.data?.id @@ -210,7 +210,7 @@ Cypress.Commands.add('shareFile', (path, options = {}) => { await axios.put( `${url}/ocs/v2.php/apps/files_sharing/api/v1/shares/${id}`, { permissions }, - { headers } + { headers }, ) cy.log(`Made share ${token} editable.`) } @@ -237,15 +237,15 @@ Cypress.Commands.add('createFolder', (target) => { }) Cypress.Commands.add('moveFile', (path, destinationPath) => cy.window() - .then(win => win.OC.Files.getClient().move(path, destinationPath)) + .then(win => win.OC.Files.getClient().move(path, destinationPath)), ) Cypress.Commands.add('removeFile', (path) => cy.window() - .then(win => win.OC.Files.getClient().remove(path)) + .then(win => win.OC.Files.getClient().remove(path)), ) Cypress.Commands.add('copyFile', (path, destinationPath) => cy.window() - .then(win => win.OC.Files.getClient().copy(path, destinationPath)) + .then(win => win.OC.Files.getClient().copy(path, destinationPath)), ) Cypress.Commands.add('getFileContent', (path) => { @@ -285,7 +285,7 @@ Cypress.Commands.add('propfindFolder', (path, depth = 0) => { }) Cypress.Commands.add('reloadFileList', () => cy.window() - .then(win => win.OCA?.Files?.App?.fileList?.reload()) + .then(win => win.OCA?.Files?.App?.fileList?.reload()), ) Cypress.Commands.add('openFolder', (name) => { @@ -391,7 +391,7 @@ Cypress.Commands.add('configureText', (key, value) => { return axios.post( `${url}/index.php/apps/text/settings`, { key, value }, - { headers: { requesttoken: win.OC.requestToken } } + { headers: { requesttoken: win.OC.requestToken } }, ) }) }) diff --git a/src/components/Editor/MediaHandler.vue b/src/components/Editor/MediaHandler.vue index 10eca9febac..f97c2652c4c 100644 --- a/src/components/Editor/MediaHandler.vue +++ b/src/components/Editor/MediaHandler.vue @@ -142,7 +142,7 @@ export default { .then((response) => { this.insertAttachment( response.data?.name, response.data?.id, file.type, - position, response.data?.dirname + position, response.data?.dirname, ) }) .catch((error) => { @@ -171,7 +171,7 @@ export default { return this.$syncService.insertAttachmentFile(filePath).then((response) => { this.insertAttachment( response.data?.name, response.data?.id, response.data?.mimetype, - null, response.data?.dirname + null, response.data?.dirname, ) }).catch((error) => { logger.error('Failed to insert image path', { error }) diff --git a/src/components/Editor/SessionList.vue b/src/components/Editor/SessionList.vue index e6a6ced9ade..05a759956e6 100644 --- a/src/components/Editor/SessionList.vue +++ b/src/components/Editor/SessionList.vue @@ -119,7 +119,7 @@ export default { participants() { return Object.values(this.sessions).filter((session) => session.lastContact > Date.now() / 1000 - COLLABORATOR_DISCONNECT_TIME - && (session.userId !== null || session.guestName !== null) + && (session.userId !== null || session.guestName !== null), ).sort((a, b) => a.lastContact < b.lastContact) }, currentSession() { diff --git a/src/components/Editor/Wrapper.vue b/src/components/Editor/Wrapper.vue index 1292c15e0f9..290b4c8cf2e 100644 --- a/src/components/Editor/Wrapper.vue +++ b/src/components/Editor/Wrapper.vue @@ -126,7 +126,7 @@ export default { (enable) => { // make outline state reactive through the provider Object.assign(this.outline, { enable }) - } + }, ) }, methods: { diff --git a/src/components/Menu/ActionInsertLink.vue b/src/components/Menu/ActionInsertLink.vue index 39783419537..b7ac2360113 100644 --- a/src/components/Menu/ActionInsertLink.vue +++ b/src/components/Menu/ActionInsertLink.vue @@ -139,7 +139,7 @@ export default { true, // modal FilePickerType.Choose, // type true, // directories - this.startPath // path + this.startPath, // path ) filePicker.pick().then((file) => { diff --git a/src/extensions/Markdown.js b/src/extensions/Markdown.js index 52cb4cafcde..bf40a002d18 100644 --- a/src/extensions/Markdown.js +++ b/src/extensions/Markdown.js @@ -113,7 +113,7 @@ const createMarkdownSerializer = ({ nodes, marks }) => { return { serializer: new MarkdownSerializer( { ...defaultNodes, ...extractToMarkdown(nodes) }, - { ...defaultMarks, ...extractToMarkdown(marks) } + { ...defaultMarks, ...extractToMarkdown(marks) }, ), serialize(content, options) { return this.serializer.serialize(content, { ...options, tightLists: true }) @@ -138,7 +138,7 @@ const convertNames = (object) => { } return Object.fromEntries( Object.entries(object) - .map(([name, value]) => [convert(name), value]) + .map(([name, value]) => [convert(name), value]), ) } diff --git a/src/helpers/files.js b/src/helpers/files.js index bb768ff10d4..a96ae9714f6 100644 --- a/src/helpers/files.js +++ b/src/helpers/files.js @@ -129,7 +129,7 @@ const registerFileActionFallback = () => { vm.$mount(ViewerRoot) }) }, - t('text', 'Edit') + t('text', 'Edit'), ) for (let i = 0; i < openMimetypes.length; i++) { diff --git a/src/markdownit/keepSyntax.js b/src/markdownit/keepSyntax.js index 11acb7d73bd..907bb81bf00 100644 --- a/src/markdownit/keepSyntax.js +++ b/src/markdownit/keepSyntax.js @@ -49,7 +49,7 @@ export default function keepSyntax(md) { Object.assign({}, open), Object.assign({}, token, { content: token.content.slice(index, contentNext) }), Object.assign({}, close), - Object.assign({}, token, { content: token.content.slice(contentNext) }) + Object.assign({}, token, { content: token.content.slice(contentNext) }), ) j += 3 } diff --git a/src/nodes/BulletList.js b/src/nodes/BulletList.js index 5f82533dc91..81581a05a2c 100644 --- a/src/nodes/BulletList.js +++ b/src/nodes/BulletList.js @@ -49,7 +49,7 @@ const BulletList = TiptapBulletList.extend({ return [ listInputRule( /^\s*([-+*])\s([^\s[]+)$/, - this.type + this.type, ), ] }, diff --git a/src/nodes/Table/Table.js b/src/nodes/Table/Table.js index 7ee936f5f59..64469fe9571 100644 --- a/src/nodes/Table/Table.js +++ b/src/nodes/Table/Table.js @@ -98,7 +98,7 @@ export default Table.extend({ tr.setNodeAttribute( pos, 'textAlign', - lastRow.child(i).attrs.textAlign + lastRow.child(i).attrs.textAlign, ) pos += newRow.child(i).nodeSize } @@ -122,7 +122,7 @@ export default Table.extend({ tr.setNodeAttribute( pos, 'textAlign', - lastRow.child(i).attrs.textAlign + lastRow.child(i).attrs.textAlign, ) pos += newRow.child(i).nodeSize } diff --git a/src/services/AttachmentResolver.js b/src/services/AttachmentResolver.js index 693a0ff3493..5dfaae033c8 100644 --- a/src/services/AttachmentResolver.js +++ b/src/services/AttachmentResolver.js @@ -145,7 +145,7 @@ export default class AttachmentResolver { #getImageAttachmentUrl(imageFileName, preferRawImage = false) { if (!this.#session) { return this.#davUrl( - `${this.#attachmentDirectory}/${imageFileName}` + `${this.#attachmentDirectory}/${imageFileName}`, ) } diff --git a/src/services/SyncServiceProvider.js b/src/services/SyncServiceProvider.js index b5bb8a2b3f2..5f0460ccc25 100644 --- a/src/services/SyncServiceProvider.js +++ b/src/services/SyncServiceProvider.js @@ -42,7 +42,7 @@ export default function createSyncServiceProvider({ ydoc, syncService, fileId, i 'ws://localhost:1234', 'file:' + fileId, ydoc, - { WebSocketPolyfill } + { WebSocketPolyfill }, ) websocketProvider.on('status', event => logger.debug('status', event)) return websocketProvider