From 3fbf0161ef2ef65016de5e54cac25efa3a45b225 Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Mon, 18 Nov 2024 11:39:48 +0100 Subject: [PATCH 1/4] Use new diff update API --- .../LocalWebApp/Hubs/MiniLcmApiHubBase.cs | 4 +- frontend/viewer/src/lib/Editor.svelte | 75 +------------------ .../TypedSignalR.Client/index.ts | 10 +-- .../viewer/src/lib/in-memory-api-service.ts | 11 +-- .../viewer/src/lib/services/lexbox-api.ts | 2 +- 5 files changed, 15 insertions(+), 87 deletions(-) diff --git a/backend/FwLite/LocalWebApp/Hubs/MiniLcmApiHubBase.cs b/backend/FwLite/LocalWebApp/Hubs/MiniLcmApiHubBase.cs index 36fa19493..5f477f6e8 100644 --- a/backend/FwLite/LocalWebApp/Hubs/MiniLcmApiHubBase.cs +++ b/backend/FwLite/LocalWebApp/Hubs/MiniLcmApiHubBase.cs @@ -65,9 +65,9 @@ public virtual async Task CreateEntry(Entry entry) return newEntry; } - public virtual async Task UpdateEntry(Guid id, JsonPatchDocument update) + public virtual async Task UpdateEntry(Entry before, Entry after) { - var entry = await miniLcmApi.UpdateEntry(id, new UpdateObjectInput(update)); + var entry = await miniLcmApi.UpdateEntry(before, after); await NotifyEntryUpdated(entry); return entry; } diff --git a/frontend/viewer/src/lib/Editor.svelte b/frontend/viewer/src/lib/Editor.svelte index dec8bec88..71bf2492f 100644 --- a/frontend/viewer/src/lib/Editor.svelte +++ b/frontend/viewer/src/lib/Editor.svelte @@ -2,9 +2,7 @@ import type {IEntry, IExampleSentence, ISense} from './mini-lcm'; import EntryEditor from './entry-editor/object-editors/EntryEditor.svelte'; import {createEventDispatcher, getContext} from 'svelte'; - import jsonPatch from 'fast-json-patch'; import {useLexboxApi} from './services/service-provider'; - import {isEmptyId} from './utils'; import type { SaveHandler } from './services/save-event-service'; import {useViewSettings} from './services/view-service'; @@ -27,26 +25,8 @@ const viewSettings = useViewSettings(); - function withoutSenses(entry: IEntry): Omit { - let {senses, ...rest} = entry; - return rest; - } - function withoutExamples(sense: ISense): Omit { - let {exampleSentences, ...rest} = sense; - return rest; - } - async function onChange(e: { entry: IEntry, sense?: ISense, example?: IExampleSentence }) { await updateEntry(e.entry); - if (e.sense !== undefined) { - await updateSense(e.sense); - detectSenseIndexChanges(e.entry, e.sense); - if (e.example !== undefined) { - await updateExample(e.sense.id, e.example); - detectExampleIndexChanges(e.entry, e.sense, e.example); - } - } - dispatch('change', {entry: e.entry}); updateInitialEntry(); } @@ -66,60 +46,7 @@ async function updateEntry(updatedEntry: IEntry) { if (entry.id != updatedEntry.id) throw new Error('Entry id mismatch'); - let operations = jsonPatch.compare(withoutSenses(initialEntry), withoutSenses(updatedEntry)); - if (operations.length == 0) return; - console.debug('updateEntry', operations); - await saveHandler(() => lexboxApi.UpdateEntry(updatedEntry.id, operations)); - } - - async function updateSense(updatedSense: ISense) { - if (isEmptyId(updatedSense.id)) { - updatedSense.id = crypto.randomUUID(); - await saveHandler(() => lexboxApi.CreateSense(entry.id, updatedSense)); - return; - } - const initialSense = initialEntry.senses.find(s => s.id === updatedSense.id); - if (!initialSense) throw new Error('Sense not found in initial entry'); - let operations = jsonPatch.compare(withoutExamples(initialSense), withoutExamples(updatedSense)); - if (operations.length == 0) return; - console.debug('updateSense', operations); - await saveHandler(() => lexboxApi.UpdateSense(entry.id, updatedSense.id, operations)); - } - - async function updateExample(senseId: string, updatedExample: IExampleSentence) { - const initialSense = initialEntry.senses.find(s => s.id === senseId); - if (!initialSense) throw new Error('Sense not found in initial entry'); - if (isEmptyId(updatedExample.id)) { - updatedExample.id = crypto.randomUUID(); - await saveHandler(() => lexboxApi.CreateExampleSentence(entry.id, senseId, updatedExample)); - return; - } - const initialExample = initialSense.exampleSentences.find(e => e.id === updatedExample.id); - if (!initialExample) throw new Error('Example not found in initial sense'); - let operations = jsonPatch.compare(initialExample, updatedExample); - if (operations.length == 0) return; - console.debug('updateExample', operations); - await saveHandler(() => lexboxApi.UpdateExampleSentence(entry.id, senseId, updatedExample.id, operations)); - } - - function detectSenseIndexChanges(entry: IEntry, sense: ISense) { - const initialIndex = initialEntry.senses.findIndex(s => s.id === sense.id); - if (initialIndex === -1) return; - const currentIndex = entry.senses.findIndex(s => s.id === sense.id); - if (currentIndex === -1) return; - if (initialIndex !== currentIndex) { - // todo figure out how to send this to the server - } - } - - function detectExampleIndexChanges(entry: IEntry, sense: ISense, example: IExampleSentence) { - const initialIndex = initialEntry.senses.find(s => s.id == sense.id)?.exampleSentences.findIndex(s => s.id === example.id); - if (initialIndex === -1 || initialIndex === undefined) return; - const currentIndex = sense.exampleSentences.findIndex(s => s.id === example.id); - if (currentIndex === -1) return; - if (initialIndex !== currentIndex) { - // todo figure out how to send this to the server - } + await saveHandler(() => lexboxApi.UpdateEntry(initialEntry, updatedEntry)); } diff --git a/frontend/viewer/src/lib/generated-signalr-client/TypedSignalR.Client/index.ts b/frontend/viewer/src/lib/generated-signalr-client/TypedSignalR.Client/index.ts index 7bc72a381..bd972d5e6 100644 --- a/frontend/viewer/src/lib/generated-signalr-client/TypedSignalR.Client/index.ts +++ b/frontend/viewer/src/lib/generated-signalr-client/TypedSignalR.Client/index.ts @@ -3,10 +3,10 @@ /* tslint:disable */ import type {ComplexFormType, Entry, ExampleSentence, PartOfSpeech, QueryOptions, SemanticDomain, Sense, WritingSystem, WritingSystems} from '../../mini-lcm'; -import type { ILexboxApiHub, ILexboxClient } from './Lexbox.ClientServer.Hubs'; +import type {ILexboxApiHub, ILexboxClient} from './Lexbox.ClientServer.Hubs'; -import { HubConnection } from '@microsoft/signalr'; -import type { JsonOperation } from '../Lexbox.ClientServer.Hubs'; +import {HubConnection} from '@microsoft/signalr'; +import type {JsonOperation} from '../Lexbox.ClientServer.Hubs'; import type {WritingSystemType} from '../../services/lexbox-api'; // components @@ -174,8 +174,8 @@ class ILexboxApiHub_HubProxy implements ILexboxApiHub { return await this.connection.invoke("CreateEntry", entry); } - public readonly UpdateEntry = async (id: string, update: JsonOperation[]): Promise => { - return await this.connection.invoke("UpdateEntry", id, update); + public readonly UpdateEntry = async (before: Entry, after: Entry): Promise => { + return await this.connection.invoke("UpdateEntry", before, after); } public readonly DeleteEntry = async (id: string): Promise => { diff --git a/frontend/viewer/src/lib/in-memory-api-service.ts b/frontend/viewer/src/lib/in-memory-api-service.ts index 70878dbb5..6e6226e9a 100644 --- a/frontend/viewer/src/lib/in-memory-api-service.ts +++ b/frontend/viewer/src/lib/in-memory-api-service.ts @@ -1,4 +1,6 @@ -import {entries, projectName, writingSystems} from './entry-data'; +/* eslint-disable @typescript-eslint/naming-convention */ + +import {entries, projectName, writingSystems} from './entry-data'; import type { IEntry, IExampleSentence, @@ -123,10 +125,9 @@ export class InMemoryApiService implements LexboxApiClient { return Promise.resolve(entry); } - UpdateEntry(guid: string, update: JsonPatch): Promise { - const entry = entries.find(e => e.id === guid)!; - applyPatch(entry, update); - return Promise.resolve(entry); + UpdateEntry(_before: IEntry, after: IEntry): Promise { + entries.splice(entries.findIndex(e => e.id === after.id), 1, after); + return Promise.resolve(after); } CreateSense(entryGuid: string, sense: ISense): Promise { diff --git a/frontend/viewer/src/lib/services/lexbox-api.ts b/frontend/viewer/src/lib/services/lexbox-api.ts index e968a01ad..8226378f4 100644 --- a/frontend/viewer/src/lib/services/lexbox-api.ts +++ b/frontend/viewer/src/lib/services/lexbox-api.ts @@ -37,7 +37,7 @@ export interface LexboxApi { GetEntry(guid: string): Promise; CreateEntry(entry: IEntry): Promise; - UpdateEntry(guid: string, update: JsonPatch): Promise; + UpdateEntry(before: IEntry, after: IEntry): Promise; DeleteEntry(guid: string): Promise; CreateSense(entryGuid: string, sense: ISense): Promise; From dde589bf46ee4c59a9509259f66975ffe3979a26 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Tue, 19 Nov 2024 09:33:34 +0700 Subject: [PATCH 2/4] upgrade autofaker and make all instances static --- backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs | 6 +++--- .../FwLiteProjectSync.Tests.csproj | 2 +- backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs | 8 ++++---- backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs | 4 ++-- backend/FwLite/LcmCrdt.Tests/EntityCopyMethodTests.cs | 4 ++-- backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj | 2 +- backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj | 2 +- backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs b/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs index 523f73526..d1b264839 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs +++ b/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs @@ -9,7 +9,7 @@ namespace FwLiteProjectSync.Tests; public class EntrySyncTests : IClassFixture { - private readonly AutoFaker _autoFaker = new(builder => builder.WithOverride(new MultiStringOverride()).WithOverride(new ObjectWithIdOverride())); + private static readonly AutoFaker AutoFaker = new(builder => builder.WithOverride(new MultiStringOverride()).WithOverride(new ObjectWithIdOverride())); public EntrySyncTests(SyncFixture fixture) { _fixture = fixture; @@ -20,8 +20,8 @@ public EntrySyncTests(SyncFixture fixture) [Fact] public async Task CanSyncRandomEntries() { - var createdEntry = await _fixture.CrdtApi.CreateEntry(await _autoFaker.EntryReadyForCreation(_fixture.CrdtApi)); - var after = await _autoFaker.EntryReadyForCreation(_fixture.CrdtApi, entryId: createdEntry.Id); + var createdEntry = await _fixture.CrdtApi.CreateEntry(await AutoFaker.EntryReadyForCreation(_fixture.CrdtApi)); + var after = await AutoFaker.EntryReadyForCreation(_fixture.CrdtApi, entryId: createdEntry.Id); await EntrySync.Sync(after, createdEntry, _fixture.CrdtApi); var actual = await _fixture.CrdtApi.GetEntry(after.Id); actual.Should().NotBeNull(); diff --git a/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj b/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj index ea6572e46..1ae1063f4 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj +++ b/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj @@ -21,7 +21,7 @@ - + all diff --git a/backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs b/backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs index 9d1feffa2..2d1eb2058 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs +++ b/backend/FwLite/FwLiteProjectSync.Tests/UpdateDiffTests.cs @@ -9,7 +9,7 @@ namespace FwLiteProjectSync.Tests; public class UpdateDiffTests { - private readonly AutoFaker _autoFaker = new(new AutoFakerConfig() + private static readonly AutoFaker AutoFaker = new(new AutoFakerConfig() { Overrides = [new MultiStringOverride(), new WritingSystemIdOverride()] }); @@ -18,7 +18,7 @@ public class UpdateDiffTests public void EntryDiffShouldUpdateAllFields() { var before = new Entry(); - var after = _autoFaker.Generate(); + var after = AutoFaker.Generate(); var entryDiffToUpdate = EntrySync.EntryDiffToUpdate(before, after); ArgumentNullException.ThrowIfNull(entryDiffToUpdate); entryDiffToUpdate.Apply(before); @@ -33,7 +33,7 @@ public void EntryDiffShouldUpdateAllFields() public async Task SenseDiffShouldUpdateAllFields() { var before = new Sense(); - var after = _autoFaker.Generate(); + var after = AutoFaker.Generate(); var senseDiffToUpdate = await SenseSync.SenseDiffToUpdate(before, after); ArgumentNullException.ThrowIfNull(senseDiffToUpdate); senseDiffToUpdate.Apply(before); @@ -44,7 +44,7 @@ public async Task SenseDiffShouldUpdateAllFields() public void ExampleSentenceDiffShouldUpdateAllFields() { var before = new ExampleSentence(); - var after = _autoFaker.Generate(); + var after = AutoFaker.Generate(); var exampleSentenceDiffToUpdate = ExampleSentenceSync.DiffToUpdate(before, after); ArgumentNullException.ThrowIfNull(exampleSentenceDiffToUpdate); exampleSentenceDiffToUpdate.Apply(before); diff --git a/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs b/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs index c08c3812c..359edff20 100644 --- a/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs @@ -17,7 +17,7 @@ namespace LcmCrdt.Tests; public class DataModelSnapshotTests : IAsyncLifetime { - private static AutoFaker _faker = new AutoFaker(new AutoFakerConfig() + private static readonly AutoFaker Faker = new AutoFaker(new AutoFakerConfig() { Overrides = [new MultiStringOverride(), new WritingSystemIdOverride()] }); @@ -90,7 +90,7 @@ public void VerifyIObjectWithIdsMatchAdapterGetObjectTypeName() foreach (var jsonDerivedType in types) { var typeDiscriminator = jsonDerivedType.TypeDiscriminator.Should().BeOfType().Subject; - var obj = _faker.Generate(jsonDerivedType.DerivedType); + var obj = Faker.Generate(jsonDerivedType.DerivedType); new MiniLcmCrdtAdapter((IObjectWithId)obj).GetObjectTypeName().Should().Be(typeDiscriminator); } } diff --git a/backend/FwLite/LcmCrdt.Tests/EntityCopyMethodTests.cs b/backend/FwLite/LcmCrdt.Tests/EntityCopyMethodTests.cs index 395615d46..3caf45d35 100644 --- a/backend/FwLite/LcmCrdt.Tests/EntityCopyMethodTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/EntityCopyMethodTests.cs @@ -9,7 +9,7 @@ namespace LcmCrdt.Tests; public class EntityCopyMethodTests { - private readonly AutoFaker _autoFaker = new(new AutoFakerConfig() + private static readonly AutoFaker AutoFaker = new(new AutoFakerConfig() { Overrides = [new MultiStringOverride(), new WritingSystemIdOverride()] }); @@ -35,7 +35,7 @@ public static IEnumerable GetEntityTypes() public void EntityCopyMethodShouldCopyAllFields(Type type) { type.IsAssignableTo(typeof(IObjectWithId)).Should().BeTrue(); - var entity = (IObjectWithId) _autoFaker.Generate(type); + var entity = (IObjectWithId) AutoFaker.Generate(type); var copy = entity.Copy(); copy.Should().BeEquivalentTo(entity, options => options.IncludingAllRuntimeProperties()); } diff --git a/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj b/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj index 2b9260c62..d955b734a 100644 --- a/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj +++ b/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj b/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj index 86bcc41df..83030857f 100644 --- a/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj +++ b/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj @@ -20,7 +20,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs b/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs index f4ee8de99..1b5601be2 100644 --- a/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs +++ b/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs @@ -6,7 +6,7 @@ namespace MiniLcm.Tests; public abstract class MiniLcmTestBase : IAsyncLifetime { - protected readonly AutoFaker AutoFaker = new(builder => + protected static readonly AutoFaker AutoFaker = new(builder => builder.WithOverride(new MultiStringOverride(["en"])) .WithOverride(new ObjectWithIdOverride()) ); From 7e766cd76cfa6604c3e3e6cadeb4f6a61e6dae02 Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Tue, 19 Nov 2024 14:07:43 +0100 Subject: [PATCH 3/4] Improve svelte-check and linting so all problems are shown at once --- .github/workflows/develop-ui.yaml | 6 ++++-- frontend/Taskfile.yml | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/develop-ui.yaml b/.github/workflows/develop-ui.yaml index f1ceb5a70..dcabd4793 100644 --- a/.github/workflows/develop-ui.yaml +++ b/.github/workflows/develop-ui.yaml @@ -62,8 +62,10 @@ jobs: cache-dependency-path: './frontend/pnpm-lock.yaml' - run: pnpm install - run: pnpm run -r build # We need code/types generated by the build (e.g. gql/generated) - - run: pnpm run -r check --output machine - - run: pnpm run -r lint:report + - id: svelte_check + run: pnpm run -r --no-bail check --output machine + - run: pnpm run -r --no-bail lint:report + if: ${{ always() && steps.svelte_check.outcome != 'cancelled' }} - name: Annotate Code Linting REsults uses: ataylorme/eslint-annotate-action@d57a1193d4c59cbfbf3f86c271f42612f9dbd9e9 # v3.0.0 if: always() diff --git a/frontend/Taskfile.yml b/frontend/Taskfile.yml index 1c911f094..4c37bd215 100644 --- a/frontend/Taskfile.yml +++ b/frontend/Taskfile.yml @@ -36,9 +36,10 @@ tasks: desc: "Runs the frontend code checks done in CI. Note: the app must be built." aliases: [ sc, svelte-check ] deps: [ install ] + ignore_error: true cmds: - - pnpm run check - - pnpm run lint + - pnpm run {{.CLI_ARGS}} --no-bail check + - pnpm run {{.CLI_ARGS}} --no-bail lint svelte: desc: "Directory independent access to pnpm. E.g. `task svelte -- install`" From f9087e6b38b81118b33c1464bbddfba63007cd59 Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Tue, 19 Nov 2024 14:20:19 +0100 Subject: [PATCH 4/4] Fix svelte-check and lint issues --- .../project/[project_code]/viewer/lfClassicLexboxApi.ts | 2 +- frontend/viewer/src/lib/DictionaryEntry.svelte | 2 +- frontend/viewer/src/lib/complex-form-types.ts | 3 +++ frontend/viewer/src/lib/search-bar/SearchBar.svelte | 4 ++-- frontend/viewer/src/lib/services/service-provider.ts | 5 +++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts b/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts index ee96d87cd..fca833cb2 100644 --- a/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts +++ b/frontend/src/routes/(authenticated)/project/[project_code]/viewer/lfClassicLexboxApi.ts @@ -120,7 +120,7 @@ export class LfClassicLexboxApi implements LexboxApiClient { throw new Error('Method not implemented.'); } - UpdateEntry(_guid: string, _update: JsonPatch): Promise { + UpdateEntry(_before: IEntry, _after: IEntry): Promise { throw new Error('Method not implemented.'); } diff --git a/frontend/viewer/src/lib/DictionaryEntry.svelte b/frontend/viewer/src/lib/DictionaryEntry.svelte index e2de23d24..939a539da 100644 --- a/frontend/viewer/src/lib/DictionaryEntry.svelte +++ b/frontend/viewer/src/lib/DictionaryEntry.svelte @@ -16,7 +16,7 @@ import { derived } from 'svelte/store'; import type { IEntry } from './mini-lcm'; - import { headword, pickBestAlternative } from './utils'; + import { headword } from './utils'; import {useWritingSystems} from './writing-systems'; import { usePartsOfSpeech } from './parts-of-speech'; diff --git a/frontend/viewer/src/lib/complex-form-types.ts b/frontend/viewer/src/lib/complex-form-types.ts index 89c2d9eb7..e13cb1778 100644 --- a/frontend/viewer/src/lib/complex-form-types.ts +++ b/frontend/viewer/src/lib/complex-form-types.ts @@ -8,6 +8,9 @@ export function useComplexFormTypes(): Readable { complexFormTypesStore = writable(null, (set) => { useLexboxApi().GetComplexFormTypes().then(complexFormTypes => { set(complexFormTypes); + }).catch(error => { + console.error('Failed to load parts of speech', error); + throw error; }); }); } diff --git a/frontend/viewer/src/lib/search-bar/SearchBar.svelte b/frontend/viewer/src/lib/search-bar/SearchBar.svelte index 1bd9220cf..f60d9358e 100644 --- a/frontend/viewer/src/lib/search-bar/SearchBar.svelte +++ b/frontend/viewer/src/lib/search-bar/SearchBar.svelte @@ -3,9 +3,9 @@ import { Button, Dialog, Field, Icon, ListItem, ProgressCircle, TextField } from 'svelte-ux'; import { firstDefOrGlossVal, headword } from '../utils'; import { useLexboxApi } from '../services/service-provider'; - import { derived, writable, type Writable } from 'svelte/store'; + import { derived, type Writable } from 'svelte/store'; import { deriveAsync } from '../utils/time'; - import {createEventDispatcher, getContext, onDestroy, onMount} from 'svelte'; + import {createEventDispatcher, getContext, onDestroy} from 'svelte'; import type { IEntry } from '../mini-lcm'; import {useSearch} from './search'; diff --git a/frontend/viewer/src/lib/services/service-provider.ts b/frontend/viewer/src/lib/services/service-provider.ts index 6564a740c..7deed7a15 100644 --- a/frontend/viewer/src/lib/services/service-provider.ts +++ b/frontend/viewer/src/lib/services/service-provider.ts @@ -4,9 +4,10 @@ import {openSearch} from '../search-bar/search'; declare global { interface Lexbox { - // eslint-disable-next-line @typescript-eslint/naming-convention + /* eslint-disable @typescript-eslint/naming-convention */ ServiceProvider: LexboxServiceProvider; - Search: { openSearch: (search: string) => void }; + Search: {openSearch: (search: string) => void}; + /* eslint-enable @typescript-eslint/naming-convention */ } interface Window {