From 49f435284f6000f94497be3cdaa074434b56e8b6 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Mon, 3 Apr 2023 14:10:26 +0200 Subject: [PATCH] lint --- src/structs/Item.js | 28 +++++++++++++-------------- src/utils/UndoManager.js | 4 ++-- tests/undo-redo.tests.js | 42 ++++++++++++++++++++-------------------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/structs/Item.js b/src/structs/Item.js index dd691c21..7e1bc92c 100644 --- a/src/structs/Item.js +++ b/src/structs/Item.js @@ -761,48 +761,48 @@ export class AbstractContent { } /** - * @param {number} offset + * @param {number} _offset * @return {AbstractContent} */ - splice (offset) { + splice (_offset) { throw error.methodUnimplemented() } /** - * @param {AbstractContent} right + * @param {AbstractContent} _right * @return {boolean} */ - mergeWith (right) { + mergeWith (_right) { throw error.methodUnimplemented() } /** - * @param {Transaction} transaction - * @param {Item} item + * @param {Transaction} _transaction + * @param {Item} _item */ - integrate (transaction, item) { + integrate (_transaction, _item) { throw error.methodUnimplemented() } /** - * @param {Transaction} transaction + * @param {Transaction} _transaction */ - delete (transaction) { + delete (_transaction) { throw error.methodUnimplemented() } /** - * @param {StructStore} store + * @param {StructStore} _store */ - gc (store) { + gc (_store) { throw error.methodUnimplemented() } /** - * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder - * @param {number} offset + * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder + * @param {number} _offset */ - write (encoder, offset) { + write (_encoder, _offset) { throw error.methodUnimplemented() } diff --git a/src/utils/UndoManager.js b/src/utils/UndoManager.js index c42fba71..746d0f01 100644 --- a/src/utils/UndoManager.js +++ b/src/utils/UndoManager.js @@ -10,7 +10,7 @@ import { getItemCleanStart, isDeleted, addToDeleteSet, - Transaction, Doc, Item, GC, DeleteSet, AbstractType, YEvent // eslint-disable-line + Transaction, Doc, Item, GC, DeleteSet, AbstractType // eslint-disable-line } from '../internals.js' import * as time from 'lib0/time' @@ -158,7 +158,7 @@ export class UndoManager extends Observable { */ constructor (typeScope, { captureTimeout = 500, - captureTransaction = tr => true, + captureTransaction = _tr => true, deleteFilter = () => true, trackedOrigins = new Set([null]), ignoreRemoteMapChanges = false, diff --git a/tests/undo-redo.tests.js b/tests/undo-redo.tests.js index 1c6cecf9..1844af86 100644 --- a/tests/undo-redo.tests.js +++ b/tests/undo-redo.tests.js @@ -1,4 +1,4 @@ -import { init, compare, applyRandomTests, Doc } from './testHelper.js' // eslint-disable-line +import { init } from './testHelper.js' // eslint-disable-line import * as Y from '../src/index.js' import * as t from 'lib0/testing' @@ -64,9 +64,9 @@ export const testUndoText = tc => { /** * Test case to fix #241 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testEmptyTypeScope = tc => { +export const testEmptyTypeScope = _tc => { const ydoc = new Y.Doc() const um = new Y.UndoManager([], { doc: ydoc }) const yarray = ydoc.getArray() @@ -78,9 +78,9 @@ export const testEmptyTypeScope = tc => { /** * Test case to fix #241 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testDoubleUndo = tc => { +export const testDoubleUndo = _tc => { const doc = new Y.Doc() const text = doc.getText() text.insert(0, '1221') @@ -316,9 +316,9 @@ export const testUndoDeleteFilter = tc => { /** * This issue has been reported in https://discuss.yjs.dev/t/undomanager-with-external-updates/454/6 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testUndoUntilChangePerformed = tc => { +export const testUndoUntilChangePerformed = _tc => { const doc = new Y.Doc() const doc2 = new Y.Doc() doc.on('update', update => Y.applyUpdate(doc2, update)) @@ -347,9 +347,9 @@ export const testUndoUntilChangePerformed = tc => { /** * This issue has been reported in https://github.com/yjs/yjs/issues/317 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testUndoNestedUndoIssue = tc => { +export const testUndoNestedUndoIssue = _tc => { const doc = new Y.Doc({ gc: false }) const design = doc.getMap() const undoManager = new Y.UndoManager(design, { captureTimeout: 0 }) @@ -403,9 +403,9 @@ export const testUndoNestedUndoIssue = tc => { /** * This issue has been reported in https://github.com/yjs/yjs/issues/355 * - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testConsecutiveRedoBug = tc => { +export const testConsecutiveRedoBug = _tc => { const doc = new Y.Doc() const yRoot = doc.getMap() const undoMgr = new Y.UndoManager(yRoot) @@ -454,9 +454,9 @@ export const testConsecutiveRedoBug = tc => { /** * This issue has been reported in https://github.com/yjs/yjs/issues/304 * - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testUndoXmlBug = tc => { +export const testUndoXmlBug = _tc => { const origin = 'origin' const doc = new Y.Doc() const fragment = doc.getXmlFragment('t') @@ -499,9 +499,9 @@ export const testUndoXmlBug = tc => { /** * This issue has been reported in https://github.com/yjs/yjs/issues/343 * - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testUndoBlockBug = tc => { +export const testUndoBlockBug = _tc => { const doc = new Y.Doc({ gc: false }) const design = doc.getMap() @@ -559,9 +559,9 @@ export const testUndoBlockBug = tc => { * Undo text formatting delete should not corrupt peer state. * * @see https://github.com/yjs/yjs/issues/392 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testUndoDeleteTextFormat = tc => { +export const testUndoDeleteTextFormat = _tc => { const doc = new Y.Doc() const text = doc.getText() text.insert(0, 'Attack ships on fire off the shoulder of Orion.') @@ -597,9 +597,9 @@ export const testUndoDeleteTextFormat = tc => { * Undo text formatting delete should not corrupt peer state. * * @see https://github.com/yjs/yjs/issues/392 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testBehaviorOfIgnoreremotemapchangesProperty = tc => { +export const testBehaviorOfIgnoreremotemapchangesProperty = _tc => { const doc = new Y.Doc() const doc2 = new Y.Doc() doc.on('update', update => Y.applyUpdate(doc2, update, doc)) @@ -620,9 +620,9 @@ export const testBehaviorOfIgnoreremotemapchangesProperty = tc => { * Special deletion case. * * @see https://github.com/yjs/yjs/issues/447 - * @param {t.TestCase} tc + * @param {t.TestCase} _tc */ -export const testSpecialDeletionCase = tc => { +export const testSpecialDeletionCase = _tc => { const origin = 'undoable' const doc = new Y.Doc() const fragment = doc.getXmlFragment()