提交 e0621613 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

ESLint: require TS return type

上级 c03711bd
...@@ -145,6 +145,7 @@ const config = tsEslint.config( ...@@ -145,6 +145,7 @@ const config = tsEslint.config(
'@typescript-eslint/consistent-type-definitions': 0, '@typescript-eslint/consistent-type-definitions': 0,
// Sorry, we need many `any` usage. // Sorry, we need many `any` usage.
'@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-function-return-type': 2,
'@typescript-eslint/no-unsafe-member-access': 0, '@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-assignment': 0, '@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-call': 0, '@typescript-eslint/no-unsafe-call': 0,
......
...@@ -217,7 +217,7 @@ export class DirectTransport< ...@@ -217,7 +217,7 @@ export class DirectTransport<
/** /**
* Send RTCP packet. * Send RTCP packet.
*/ */
sendRtcp(rtcpPacket: Buffer) { sendRtcp(rtcpPacket: Buffer): void {
if (!Buffer.isBuffer(rtcpPacket)) { if (!Buffer.isBuffer(rtcpPacket)) {
throw new TypeError('rtcpPacket must be a Buffer'); throw new TypeError('rtcpPacket must be a Buffer');
} }
......
...@@ -505,7 +505,7 @@ export class Producer< ...@@ -505,7 +505,7 @@ export class Producer<
/** /**
* Send RTP packet (just valid for Producers created on a DirectTransport). * Send RTP packet (just valid for Producers created on a DirectTransport).
*/ */
send(rtpPacket: Buffer) { send(rtpPacket: Buffer): void {
if (!Buffer.isBuffer(rtpPacket)) { if (!Buffer.isBuffer(rtpPacket)) {
throw new TypeError('rtpPacket must be a Buffer'); throw new TypeError('rtpPacket must be a Buffer');
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论