From 21df0330120514af44c2c9e38cc91f891d71b9a4 Mon Sep 17 00:00:00 2001 From: Clem Fern Date: Sat, 22 Jul 2023 22:36:05 +0200 Subject: [PATCH] lint --- tabby-core/src/api/index.ts | 2 +- tabby-core/src/services/config.service.ts | 3 ++- tabby-core/src/services/profiles.service.ts | 9 ++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tabby-core/src/api/index.ts b/tabby-core/src/api/index.ts index 00e915d5..5c9c0ce6 100644 --- a/tabby-core/src/api/index.ts +++ b/tabby-core/src/api/index.ts @@ -16,7 +16,7 @@ export { BootstrapData, PluginInfo, BOOTSTRAP_DATA } from './mainProcess' export { HostWindowService } from './hostWindow' export { HostAppService, Platform } from './hostApp' export { FileProvider } from './fileProvider' -export { ProfileProvider, Profile, PartialProfile, ProfileSettingsComponent, ProfileGroup, PartialProfileGroup} from './profileProvider' +export { ProfileProvider, Profile, PartialProfile, ProfileSettingsComponent, ProfileGroup, PartialProfileGroup } from './profileProvider' export { PromptModalComponent } from '../components/promptModal.component' export * from './commands' diff --git a/tabby-core/src/services/config.service.ts b/tabby-core/src/services/config.service.ts index 50c0f3ab..1bc60a46 100644 --- a/tabby-core/src/services/config.service.ts +++ b/tabby-core/src/services/config.service.ts @@ -372,7 +372,7 @@ export class ConfigService { continue } - let group = groups.find(x => x.name === (p.group)) + let group = groups.find(x => x.name === p.group) if (!group) { group = { id: `${uuidv4()}`, @@ -387,6 +387,7 @@ export class ConfigService { for (const g of groups) { if (profileGroupCollapsed[g.name]) { const collapsed = profileGroupCollapsed[g.name] + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete profileGroupCollapsed[g.name] profileGroupCollapsed[g.id] = collapsed } diff --git a/tabby-core/src/services/profiles.service.ts b/tabby-core/src/services/profiles.service.ts index 33cf7e07..b198822b 100644 --- a/tabby-core/src/services/profiles.service.ts +++ b/tabby-core/src/services/profiles.service.ts @@ -80,8 +80,6 @@ export class ProfilesService { return list } - - providerForProfile (profile: PartialProfile): ProfileProvider|null { const provider = this.profileProviders.find(x => x.id === profile.type) ?? null return provider as unknown as ProfileProvider|null @@ -248,7 +246,8 @@ export class ProfilesService { /** * Set global defaults for a given profile provider */ - setProviderDefaults (provider: ProfileProvider, pdefaults: any) { + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + setProviderDefaults (provider: ProfileProvider, pdefaults: any): void { this.config.store.profileDefaults[provider.id] = pdefaults } @@ -284,7 +283,7 @@ export class ProfilesService { let groups: PartialProfileGroup[] = this.config.store.groups ?? [] groups = groups.map(x => { x.editable = true - x.collapsed = profileGroupCollapsed[x.id ?? ''] ?? false + x.collapsed = profileGroupCollapsed[x.id] ?? false if (includeProfiles) { x.profiles = profiles.filter(p => p.group === x.id) @@ -326,7 +325,7 @@ export class ProfilesService { /** * Save ProfileGroup collapse state in localStorage */ - saveProfileGroupCollapse(group: PartialProfileGroup) { + saveProfileGroupCollapse (group: PartialProfileGroup): void { const profileGroupCollapsed = JSON.parse(window.localStorage.profileGroupCollapsed ?? '{}') profileGroupCollapsed[group.id] = group.collapsed window.localStorage.profileGroupCollapsed = JSON.stringify(profileGroupCollapsed)