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

eslint: set max-lent to 100

上级 4996dfd9
...@@ -30,6 +30,17 @@ module.exports = ...@@ -30,6 +30,17 @@ module.exports =
'space-in-parens' : [ 2, 'never' ], 'space-in-parens' : [ 2, 'never' ],
'spaced-comment' : [ 2, 'always' ], 'spaced-comment' : [ 2, 'always' ],
'comma-spacing' : [ 2, { before: false, after: true } ], 'comma-spacing' : [ 2, { before: false, after: true } ],
'no-loop-func' : 2 'no-loop-func' : 2,
'max-len' : [
2,
{
code : 100,
ignoreStrings : true,
ignoreUrls : true,
ignoreTemplateLiterals : true,
tabWidth : 2,
ignoreComments : true
}
]
} }
}; };
...@@ -72,7 +72,8 @@ gulp.task('test:node', shell.task( ...@@ -72,7 +72,8 @@ gulp.task('test:node', shell.task(
gulp.task('test:worker', shell.task( gulp.task('test:worker', shell.task(
[ [
'if type make &> /dev/null; then make test; fi', 'if type make &> /dev/null; then make test; fi',
`cd worker && ./out/${process.env.MEDIASOUP_BUILDTYPE === 'Debug' ? 'Debug' : 'Release'}/mediasoup-worker-test --invisibles --use-colour=yes` `cd worker && ./out/${process.env.MEDIASOUP_BUILDTYPE === 'Debug' ?
'Debug' : 'Release'}/mediasoup-worker-test --invisibles --use-colour=yes`
], ],
{ {
verbose : true, verbose : true,
...@@ -85,12 +86,15 @@ gulp.task('rtpcapabilities', () => ...@@ -85,12 +86,15 @@ gulp.task('rtpcapabilities', () =>
let supportedRtpCapabilities = require('./lib/supportedRtpCapabilities'); let supportedRtpCapabilities = require('./lib/supportedRtpCapabilities');
return gulp.src('worker/src/RTC/Room.cpp') return gulp.src('worker/src/RTC/Room.cpp')
.pipe(replace(/(const std::string supportedRtpCapabilities =).*/, `$1 R"(${JSON.stringify(supportedRtpCapabilities)})";`)) .pipe(replace(/(const std::string supportedRtpCapabilities =).*/,
`$1 R"(${JSON.stringify(supportedRtpCapabilities)})";`))
.pipe(gulp.dest('worker/src/RTC/')) .pipe(gulp.dest('worker/src/RTC/'))
.pipe(touch()); .pipe(touch());
}); });
gulp.task('lint', gulp.series('lint:node', 'lint:worker')); // TODO: Uncomment when C++ syntax and clang-format stuff is done.
// gulp.task('lint', gulp.series('lint:node', 'lint:worker'));
gulp.task('lint', gulp.series('lint:node'));
gulp.task('test', gulp.series('test:node', 'test:worker')); gulp.task('test', gulp.series('test:node', 'test:worker'));
......
...@@ -41,7 +41,8 @@ class Channel extends EventEmitter ...@@ -41,7 +41,8 @@ class Channel extends EventEmitter
} }
else else
{ {
this._recvBuffer = Buffer.concat([ this._recvBuffer, buffer ], this._recvBuffer.length + buffer.length); this._recvBuffer = Buffer.concat([ this._recvBuffer, buffer ],
this._recvBuffer.length + buffer.length);
if (this._recvBuffer.length > NS_MAX_SIZE) if (this._recvBuffer.length > NS_MAX_SIZE)
{ {
......
...@@ -91,7 +91,8 @@ class Worker extends EventEmitter ...@@ -91,7 +91,8 @@ class Worker extends EventEmitter
logger.error('child process exited [id:%s, code:%s, signal:%s]', id, code, signal); logger.error('child process exited [id:%s, code:%s, signal:%s]', id, code, signal);
this._child = null; this._child = null;
this.close(new Error(`child process exited [id:${id}, code:${code}, signal:${signal}]`)); this.close(new Error(
`child process exited [id:${id}, code:${code}, signal:${signal}]`));
}); });
this._child.on('error', (error) => this._child.on('error', (error) =>
......
...@@ -206,7 +206,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -206,7 +206,8 @@ class RTCPeerConnectionCommon extends EventEmitter
if (this._signalingState !== 'stable') if (this._signalingState !== 'stable')
{ {
return Promise.reject(new InvalidStateError(`invalid signaling state [signalingState:${this._signalingState}]`)); return Promise.reject(new InvalidStateError(
`invalid signaling state [signalingState:${this._signalingState}]`));
} }
// Set busy flag. // Set busy flag.
...@@ -249,7 +250,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -249,7 +250,8 @@ class RTCPeerConnectionCommon extends EventEmitter
if (this._signalingState !== 'have-remote-offer') if (this._signalingState !== 'have-remote-offer')
{ {
return Promise.reject(new InvalidStateError(`invalid signaling state [signalingState:${this._signalingState}]`)); return Promise.reject(new InvalidStateError(
`invalid signaling state [signalingState:${this._signalingState}]`));
} }
// Create an answer. // Create an answer.
...@@ -281,7 +283,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -281,7 +283,8 @@ class RTCPeerConnectionCommon extends EventEmitter
case 'offer': case 'offer':
{ {
if (this._signalingState !== 'stable') if (this._signalingState !== 'stable')
return Promise.reject(new InvalidStateError(`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`)); return Promise.reject(new InvalidStateError(
`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`));
newSignalingState = 'have-local-offer'; newSignalingState = 'have-local-offer';
...@@ -291,7 +294,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -291,7 +294,8 @@ class RTCPeerConnectionCommon extends EventEmitter
case 'answer': case 'answer':
{ {
if (this._signalingState !== 'have-remote-offer') if (this._signalingState !== 'have-remote-offer')
return Promise.reject(new InvalidStateError(`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`)); return Promise.reject(new InvalidStateError(
`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`));
newSignalingState = 'stable'; newSignalingState = 'stable';
...@@ -300,7 +304,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -300,7 +304,8 @@ class RTCPeerConnectionCommon extends EventEmitter
default: default:
{ {
return Promise.reject(new Error(`invalid RTCSessionDescription.type [type:${remoteDescription.type}]`)); return Promise.reject(new Error(
`invalid RTCSessionDescription.type [type:${remoteDescription.type}]`));
} }
} }
...@@ -341,7 +346,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -341,7 +346,8 @@ class RTCPeerConnectionCommon extends EventEmitter
{ {
if (this._signalingState !== 'stable') if (this._signalingState !== 'stable')
{ {
return Promise.reject(new InvalidStateError(`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`)); return Promise.reject(new InvalidStateError(
`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`));
} }
// Initial offer received from the client. // Initial offer received from the client.
...@@ -360,7 +366,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -360,7 +366,8 @@ class RTCPeerConnectionCommon extends EventEmitter
{ {
if (this._signalingState !== 'have-local-offer') if (this._signalingState !== 'have-local-offer')
{ {
return Promise.reject(new InvalidStateError(`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`)); return Promise.reject(new InvalidStateError(
`invalid RTCSessionDescription.type [type:${remoteDescription.type}, signalingState:${this._signalingState}]`));
} }
// Initial answer received from the client. // Initial answer received from the client.
...@@ -430,7 +437,8 @@ class RTCPeerConnectionCommon extends EventEmitter ...@@ -430,7 +437,8 @@ class RTCPeerConnectionCommon extends EventEmitter
default: default:
{ {
return Promise.reject(new Error(`invalid RTCSessionDescription.type [type:${remoteDescription.type}]`)); return Promise.reject(new Error(
`invalid RTCSessionDescription.type [type:${remoteDescription.type}]`));
} }
} }
} }
......
...@@ -174,7 +174,8 @@ class RTCPeerConnectionPlanB extends RTCPeerConnectionCommon ...@@ -174,7 +174,8 @@ class RTCPeerConnectionPlanB extends RTCPeerConnectionCommon
if (!this._mapTrackToRtpReceiver.has(trackInfo.trackId)) if (!this._mapTrackToRtpReceiver.has(trackInfo.trackId))
{ {
this._logger.debug('_handleRemoteReAnswer() | new receiving track [ssrc:%s, trackId:"%s"]', ssrc, trackInfo.trackId); this._logger.debug('_handleRemoteReAnswer() | new receiving track [ssrc:%s, trackId:"%s"]',
ssrc, trackInfo.trackId);
let promise = this._createRtpReceiverForSsrc(parsedMedia, ssrc, trackInfo) let promise = this._createRtpReceiverForSsrc(parsedMedia, ssrc, trackInfo)
.then((rtpReceiver) => .then((rtpReceiver) =>
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论