Skip to content

Commit

Permalink
Fix Prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Jul 17, 2023
1 parent 4ff5194 commit e73567f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/converter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { URL } from 'url'
import type { Marp, MarpOptions } from '@marp-team/marp-core'
import { Marpit, Options as MarpitOptions } from '@marp-team/marpit'
Expand Down
4 changes: 2 additions & 2 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class File {
await this.saveToFile()
break
case FileType.StandardIO:
process.stdout.write(this.buffer!)
process.stdout.write(this.buffer!)
}
}

Expand Down Expand Up @@ -153,7 +153,7 @@ export class File {
await fs.promises.mkdir(directory, { recursive: true })
}

await fs.promises.writeFile(savePath, this.buffer!)
await fs.promises.writeFile(savePath, this.buffer!)
}

private static stdinBuffer?: Buffer
Expand Down
4 changes: 3 additions & 1 deletion src/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export interface MarpCLIInternalOptions {

export type MarpCLIAPIOptions = Pick<MarpCLIInternalOptions, 'baseUrl'>

export interface ObservationHelper { stop: () => void }
export interface ObservationHelper {
stop: () => void
}

const resolversForObservation: ((helper: ObservationHelper) => void)[] = []

Expand Down
2 changes: 1 addition & 1 deletion src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class Preview extends (EventEmitter as new () => TypedEmitter<Preview.Eve

if (url.searchParams.get('__marp_cli_id') === id) {
pptr.off('targetcreated', idMatcher)
;(async () => res((await target.page())!))()
;(async () => res((await target.page())!))()
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export class Server extends (EventEmitter as new () => TypedEmitter<Server.Event
this.directoryIndex = opts.directoryIndex || []
this.inputDir = converter.options.inputDir
this.options = opts
this.port = Number.parseInt(process.env.PORT!, 10) || 8080
this.port = Number.parseInt(process.env.PORT!, 10) || 8080
}

async start() {
await this.setup()

return new Promise<void>((res, rej) => {
this.httpServer = this.server!.listen(this.port)
this.httpServer = this.server!.listen(this.port)

this.httpServer.on('listening', res)
this.httpServer.on('error', (err) =>
Expand Down
4 changes: 1 addition & 3 deletions src/templates/bespoke/bespoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const parse = (
return patterns.map(([pat, plugin]) => pat[i] && plugin).filter((p) => p)
}

const bespokeTemplate = (
target = document.getElementById(':$p')!
) => {
const bespokeTemplate = (target = document.getElementById(':$p')!) => {
setViewMode()

const key = popQuery('sync') || undefined
Expand Down
5 changes: 4 additions & 1 deletion src/templates/bespoke/presenter/normal-view.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { generateURLfromParams, storage } from '../utils'
import { presenterPrefix } from './presenter-view'

interface BespokeForPresenter { syncKey: string; [key: string]: any }
interface BespokeForPresenter {
syncKey: string
[key: string]: any
}

const validateDeck = (deck: any): deck is BespokeForPresenter =>
deck.syncKey && typeof deck.syncKey === 'string'
Expand Down
2 changes: 1 addition & 1 deletion src/templates/bespoke/utils/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const fetchMarpTransitionKeyframes = async (
return resolved
})
}

return resolvedMarpTransitionKeyframes.get(transitionName)!
}

Expand Down
2 changes: 1 addition & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Theme {
}

get buffer() {
return this.readBuffer!
return this.readBuffer!
}

get css() {
Expand Down
1 change: 0 additions & 1 deletion src/utils/pdf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import type { PDFDocument, PDFRef } from 'pdf-lib'

// Use pre-bundled pdf-lib to avoid circular dependency warning. pdf-lib as an
Expand Down
2 changes: 1 addition & 1 deletion test/templates/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Watch mode notifier on browser context', () => {
server.once('error', (e) => rej(e))
server.once('connection', () => res(socket))

const socket = watch()!
const socket = watch()!
})

await new Promise((res) => {
Expand Down

0 comments on commit e73567f

Please sign in to comment.