Skip to content

Commit 0625ed6

Browse files
committed
add comments to ts-expect-error
1 parent be4bd83 commit 0625ed6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/server/lib/controllers/xhrs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ export = {
7070
return respond()
7171
},
7272

73-
_get (resp: string, config: { fixturesFolder: string }): Promise<{ data: any, encoding?: string }> {
74-
const options: { encoding?: string } = {}
73+
_get (resp: string, config: { fixturesFolder: string }): Promise<{ data: any, encoding?: BufferEncoding }> {
74+
const options: { encoding?: BufferEncoding } = {}
7575

7676
const file = resp.replace(fixturesRe, '')
7777

7878
const [filePath, encoding] = file.split(',')
7979

8080
if (encoding) {
81-
options.encoding = encoding
81+
options.encoding = encoding as BufferEncoding
8282
}
8383

84-
// @ts-expect-error
84+
// @ts-expect-error - bluebird to promise type mismatch
8585
return fixtureGet(config.fixturesFolder, filePath, options)
8686
.then((bytes: any) => {
8787
return {

packages/server/lib/fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export async function fileExists (p: string) {
9090
if (stat?.isDirectory()) {
9191
const err = new Error()
9292

93-
// @ts-expect-error
93+
// @ts-expect-error - code isn't typed on Error
9494
err.code = 'ENOENT'
9595
throw err
9696
}

packages/server/lib/util/terminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export const header = (message: string, options: { color?: string[] | null } = {
186186
message = ` (${chalk.underline.bold(message)})`
187187

188188
if (options.color) {
189-
// @ts-expect-error
189+
// @ts-expect-error type is cast incorrectly to never
190190
const colors = <string[]>[].concat(options.color)
191191

192192
message = _.reduce(colors, (memo, color) => {

0 commit comments

Comments
 (0)