From a95eec9223359cecdecdbe783c1f56e2472034ea Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 2 Dec 2024 16:19:10 +0100 Subject: [PATCH 1/3] fix(esling): eslint config should extend `@nextcloud` Required to import all Nextcloud eslint rules, not only the typescript ones. Signed-off-by: Jonas --- .eslintrc.cjs | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index bc019d9820d..0bab9029919 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -6,7 +6,7 @@ module.exports = { root: true, extends: [ - '@nextcloud/eslint-config/typescript', + '@nextcloud', ], rules: { '@typescript-eslint/no-unused-vars': ['off'], diff --git a/tsconfig.json b/tsconfig.json index 9d64b435b9d..43a99b75aea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "extends": "@vue/tsconfig", "compilerOptions": { "allowSyntheticDefaultImports": true, - "allowJs": true, + "allowJs": true, "declaration": true, "esModuleInterop": true, "lib": ["DOM", "ESNext"], From ddf381493df7fa191b1bb57fb061a79733b31877 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 2 Dec 2024 16:26:53 +0100 Subject: [PATCH 2/3] fix(eslint): Also lint typescript files Signed-off-by: Jonas --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9fa150e9c3c..e7be4ee9fa5 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,8 @@ "build": "NODE_ENV=production NODE_OPTIONS='--max-old-space-size=4096' vite --mode production build", "dev": "NODE_ENV=development NODE_OPTIONS='--max-old-space-size=4096' vite --mode development build", "watch": "NODE_ENV=development NODE_OPTIONS='--max-old-space-size=8192' vite --mode development build --watch", - "lint": "tsc && eslint --ext .js,.vue src cypress", - "lint:fix": "tsc && eslint --ext .js,.vue src cypress --fix", + "lint": "tsc && eslint --ext .js,.ts,.vue src cypress", + "lint:fix": "tsc && eslint --ext .js,.ts,.vue src cypress --fix", "stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss", "stylelint:fix": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss --fix", "test": "NODE_ENV=test jest", From e8da521a5ef862fbc1a394c6445b1c55cf9a7089 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 2 Dec 2024 17:53:21 +0100 Subject: [PATCH 3/3] fix: linting code style fixes to typescript files Signed-off-by: Jonas --- cypress/e2e/nodes/Links.spec.js | 8 +++++++- src/components/Editor.vue | 2 +- src/services/Outbox.ts | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/nodes/Links.spec.js b/cypress/e2e/nodes/Links.spec.js index 452fde24dbf..13d6db365e6 100644 --- a/cypress/e2e/nodes/Links.spec.js +++ b/cypress/e2e/nodes/Links.spec.js @@ -27,7 +27,13 @@ describe('test link marks', function() { describe('link bubble', function() { - function clickLink(link, options = {}) { + /** + * Find link and click on it + * + * @param {string} link The link URL + * @param {object|null} options the click options + */ + const clickLink = (link, options = {}) => { cy.getContent() .find(`a[href*="${link}"]`) .click(options) diff --git a/src/components/Editor.vue b/src/components/Editor.vue index df0eae7fe2a..939526834e1 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -92,7 +92,7 @@ import { import ReadonlyBar from './Menu/ReadonlyBar.vue' import { logger } from '../helpers/logger.js' -import { getDocumentState, applyDocumentState } from '../helpers/yjs.js' +import { getDocumentState } from '../helpers/yjs.js' import { SyncService, ERROR_TYPE, IDLE_TIMEOUT } from './../services/SyncService.js' import SessionApi from '../services/SessionApi.js' import createSyncServiceProvider from './../services/SyncServiceProvider.js' diff --git a/src/services/Outbox.ts b/src/services/Outbox.ts index 2ca82416b8d..c6301f9c547 100644 --- a/src/services/Outbox.ts +++ b/src/services/Outbox.ts @@ -11,6 +11,7 @@ type Sendable = { } export default class Outbox { + #awarenessUpdate = '' #syncUpdate = '' #syncQuery = '' @@ -33,7 +34,7 @@ export default class Outbox { } getDataToSend(): Sendable { - return { + return { steps: [this.#syncUpdate, this.#syncQuery].filter(s => s), awareness: this.#awarenessUpdate, }