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

Add more eslint rules.

上级 0f81cc4b
......@@ -17,30 +17,56 @@ module.exports =
},
'rules' :
{
'comma-dangle' : 2,
'comma-spacing' : [ 2, { before: false, after: true } ],
'max-len' :
[
2,
{
code : 100,
ignoreStrings : true,
ignoreUrls : true,
ignoreTemplateLiterals : true,
tabWidth : 2,
ignoreComments : true
}
],
'no-console' : 0,
'no-constant-condition' : 2,
'no-control-regex' : 2,
'no-dupe-args' : 2,
'no-dupe-keys' : 2,
'no-duplicate-case' : 2,
'no-empty' : 0,
'no-empty-character-class' : 2,
'no-ex-assign' : 2,
'no-extra-boolean-cast' : 2,
'no-extra-parens' : [ 2, 'all', { nestedBinaryExpressions: false } ],
'no-extra-semi' : 2,
'no-func-assign' : 2,
'no-inner-declarations' : 2,
'no-invalid-regexp' : 2,
'no-irregular-whitespace' : 2,
'no-loop-func' : 2,
'no-negated-in-lhs' : 2,
'no-obj-calls' : 2,
'no-prototype-builtins' : 2,
'no-regex-spaces' : 2,
'no-sparse-arrays' : 2,
'no-undef' : 2,
'no-unexpected-multiline' : 2,
'no-unreachable' : 2,
'no-unsafe-finally' : 2,
'no-unused-vars' : [ 2, { vars: 'all', args: 'after-used' }],
'no-empty' : 0,
'quotes' : [ 2, 'single', { avoidEscape: true } ],
'semi' : [ 2, 'always' ],
'no-multi-spaces' : 0,
'no-whitespace-before-property' : 2,
'quotes' : [ 2, 'single', { avoidEscape: true } ],
'semi' : [ 2, 'always' ],
'space-before-blocks' : 2,
'space-before-function-paren' : [ 2, 'never' ],
'space-in-parens' : [ 2, 'never' ],
'spaced-comment' : [ 2, 'always' ],
'comma-spacing' : [ 2, { before: false, after: true } ],
'no-loop-func' : 2,
'max-len' : [
2,
{
code : 100,
ignoreStrings : true,
ignoreUrls : true,
ignoreTemplateLiterals : true,
tabWidth : 2,
ignoreComments : true
}
]
'use-isnan' : 2,
'valid-typeof' : 2
}
};
......@@ -12,8 +12,8 @@ const WELL_KNOWN_SDP_PARAMS_TO_ORTC = new Map([
[ 'sprop-maxcapturerate', 'spropMaxCaptureRate' ],
// FLEXFEC parameters.
// https://tools.ietf.org/html/draft-ietf-payload-flexible-fec-scheme
[ 'L', 'l', ],
[ 'D', 'd', ],
[ 'L', 'l' ],
[ 'D', 'd' ],
[ 'ToP', 'toP' ]
]);
......
......@@ -218,10 +218,10 @@ class RTCPeerConnectionCommon extends EventEmitter
// Just for the initial SDP O/A.
if (!this._initialNegotiationDone && options)
{
if (options.hasOwnProperty('offerToReceiveAudio'))
if (Object.prototype.hasOwnProperty.call(options, 'offerToReceiveAudio'))
this._initialCreateOfferOptions.offerToReceiveAudio = options.offerToReceiveAudio;
if (options.hasOwnProperty('offerToReceiveVideo'))
if (Object.prototype.hasOwnProperty.call(options, 'offerToReceiveVideo'))
this._initialCreateOfferOptions.offerToReceiveVideo = options.offerToReceiveVideo;
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论