chore: upgrade eslint and prettier (#2376)
* chore: upgrade eslint and prettier * chore: add restrict-template-expressions
This commit is contained in:
@@ -10,7 +10,10 @@ export abstract class AbstractViewController<Event = void, EventData = void> {
|
||||
protected disposers: Disposer[] = []
|
||||
private eventObservers: ControllerEventObserver<Event, EventData>[] = []
|
||||
|
||||
constructor(public application: WebApplication, protected eventBus: InternalEventBusInterface) {}
|
||||
constructor(
|
||||
public application: WebApplication,
|
||||
protected eventBus: InternalEventBusInterface,
|
||||
) {}
|
||||
|
||||
protected async publishCrossControllerEventSync(name: CrossControllerEvent, data?: unknown): Promise<void> {
|
||||
await this.eventBus.publishSync({ type: name, payload: data }, InternalEventPublishStrategy.SEQUENCE)
|
||||
|
||||
@@ -8,7 +8,10 @@ export class PersistenceService {
|
||||
private unsubAppEventObserver: () => void
|
||||
private didHydrateOnce = false
|
||||
|
||||
constructor(private application: WebApplication, private eventBus: InternalEventBusInterface) {
|
||||
constructor(
|
||||
private application: WebApplication,
|
||||
private eventBus: InternalEventBusInterface,
|
||||
) {
|
||||
this.unsubAppEventObserver = this.application.addEventObserver(async (eventName) => {
|
||||
if (!this.application) {
|
||||
return
|
||||
|
||||
@@ -46,8 +46,8 @@ export class FilePreviewModalController {
|
||||
|
||||
deinit = () => {
|
||||
this.eventObservers.forEach((observer) => observer())
|
||||
;(this.currentFile as any) = undefined
|
||||
;(this.otherFiles as any) = undefined
|
||||
;(this.currentFile as unknown) = undefined
|
||||
;(this.otherFiles as unknown) = undefined
|
||||
}
|
||||
|
||||
setCurrentFile = (currentFile: FileItem) => {
|
||||
|
||||
@@ -27,7 +27,10 @@ export class ImportModalController {
|
||||
files: ImportModalFile[] = []
|
||||
importTag: SNTag | undefined = undefined
|
||||
|
||||
constructor(private application: WebApplication, private navigationController: NavigationController) {
|
||||
constructor(
|
||||
private application: WebApplication,
|
||||
private navigationController: NavigationController,
|
||||
) {
|
||||
makeObservable(this, {
|
||||
isVisible: observable,
|
||||
setIsVisible: action,
|
||||
|
||||
@@ -23,7 +23,10 @@ export class NoteSyncController {
|
||||
|
||||
private saveTimeout?: ReturnType<typeof setTimeout>
|
||||
|
||||
constructor(private application: WebApplication, private item: SNNote) {}
|
||||
constructor(
|
||||
private application: WebApplication,
|
||||
private item: SNNote,
|
||||
) {}
|
||||
|
||||
setItem(item: SNNote) {
|
||||
this.item = item
|
||||
|
||||
@@ -27,7 +27,7 @@ export function panesForLayout(layout: PaneLayout, application: WebApplication):
|
||||
}
|
||||
}
|
||||
|
||||
throw Error(`Unhandled pane layout ${layout}`)
|
||||
throw Error('Unhandled pane layout')
|
||||
}
|
||||
|
||||
export function isPanesChangeLeafDismiss(from: AppPaneId[], to: AppPaneId[]): boolean {
|
||||
|
||||
@@ -80,7 +80,10 @@ export class ViewControllerManager implements InternalEventHandlerInterface {
|
||||
private applicationEventObserver: EventObserverInterface
|
||||
private toastService: ToastServiceInterface
|
||||
|
||||
constructor(public application: WebApplication, private device: WebOrDesktopDeviceInterface) {
|
||||
constructor(
|
||||
public application: WebApplication,
|
||||
private device: WebOrDesktopDeviceInterface,
|
||||
) {
|
||||
const eventBus = application.events
|
||||
|
||||
this.persistenceService = new PersistenceService(application, eventBus)
|
||||
|
||||
Reference in New Issue
Block a user