chore: upgrade eslint and prettier (#2376)

* chore: upgrade eslint and prettier

* chore: add restrict-template-expressions
This commit is contained in:
Mo
2023-07-27 14:36:05 -05:00
committed by GitHub
parent acc41edb02
commit 4a29e2a24c
1283 changed files with 4416 additions and 5131 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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) => {

View File

@@ -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,

View File

@@ -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

View File

@@ -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 {

View File

@@ -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)