From e84762a82b083a99cce7d84e1f1274151390360b Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Tue, 24 Nov 2015 00:29:12 -0600 Subject: [PATCH] Fixes warnings, sets up .jshintrc and ignores files in .jshintignore. --- .jshintignore | 34 ++++++++++++++++++++++++++++---- .jshintrc | 7 +++++-- JitsiConferenceErrors.js | 3 ++- JitsiConferenceEvents.js | 3 ++- JitsiConnectionErrors.js | 3 ++- modules/xmpp/strophe.moderate.js | 5 +++-- modules/xmpp/strophe.rayo.js | 5 +++-- modules/xmpp/strophe.util.js | 1 + 8 files changed, 48 insertions(+), 13 deletions(-) diff --git a/.jshintignore b/.jshintignore index 3c7ab2ba9..9881bb30b 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,6 +1,32 @@ node_modules libs -replacement.js -prezi.js -muc.js -app.js +lib-jitsi-meet.js +doc + + +modules/xmpp/xmpp.js +modules/xmpp/strophe.jingle.js +modules/xmpp/TraceablePeerConnection.js +modules/xmpp/SDPUtil.js +modules/xmpp/SDP.js +modules/xmpp/strophe.emuc.js +modules/xmpp/JingleSessionPC.js +modules/xmpp/LocalSSRCReplacement.js +modules/xmpp/ChatRoom.js +modules/xmpp/ChatRoom.js +modules/statistics/RTPStatsCollector.js +modules/statistics/LocalStatsCollector.js +modules/settings/Settings.js +modules/connectionquality/connectionquality.js +modules/RTC/adapter.screenshare.js +modules/statistics/statistics.js +modules/RTC/RTC.js +modules/RTC/RTCUtils.js +modules/RTC/DataChannels.js +modules/RTC/JitsiLocalTrack.js +modules/RTC/JitsiRemoteTrack.js +modules/RTC/JitsiTrack.js +JitsiParticipant.js +JitsiMeetJS.js +JitsiConnection.js +JitsiConference.js diff --git a/.jshintrc b/.jshintrc index 8f9506cdf..a86fe00e7 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,5 @@ { + // Refer to http://jshint.com/docs/options/ for an exhaustive list of options "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) "expr": true, // true: Tolerate `ExpressionStatement` as Programs "loopfunc": true, // true: Tolerate functions being defined in loops @@ -12,5 +13,7 @@ "indent": 4, // {int} Number of spaces to use for indentation "latedef": true, // true: Require variables/functions to be defined before being used "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()` - "maxlen": 80 // {int} Max number of characters per line -} \ No newline at end of file + "maxlen": 80, // {int} Max number of characters per line + "latedef": false, //This option prohibits the use of a variable before it was defined + "laxbreak": true //Ignore line breaks around "=", "==", "&&", etc. +} diff --git a/JitsiConferenceErrors.js b/JitsiConferenceErrors.js index 9c9585034..209aaf0f8 100644 --- a/JitsiConferenceErrors.js +++ b/JitsiConferenceErrors.js @@ -8,7 +8,8 @@ var JitsiConferenceErrors = { */ PASSWORD_REQUIRED: "conference.passwordRequired", /** - * Indicates that a connection error occurred when trying to join a conference. + * Indicates that a connection error occurred when trying to join a + * conference. */ CONNECTION_ERROR: "conference.connectionError", /** diff --git a/JitsiConferenceEvents.js b/JitsiConferenceEvents.js index d543c104d..a69e0766f 100644 --- a/JitsiConferenceEvents.js +++ b/JitsiConferenceEvents.js @@ -56,7 +56,8 @@ var JitsiConferenceEvents = { */ TRACK_AUDIO_LEVEL_CHANGED: "conference.audioLevelsChanged", /** - * Indicates that the connection to the conference has been interrupted for some reason. + * Indicates that the connection to the conference has been interrupted + * for some reason. */ CONNECTION_INTERRUPTED: "conference.connecionInterrupted", /** diff --git a/JitsiConnectionErrors.js b/JitsiConnectionErrors.js index c42e69496..e8afcb0d2 100644 --- a/JitsiConnectionErrors.js +++ b/JitsiConnectionErrors.js @@ -8,7 +8,8 @@ var JitsiConnectionErrors = { */ PASSWORD_REQUIRED: "connection.passwordRequired", /** - * Indicates that a connection error occurred when trying to join a conference. + * Indicates that a connection error occurred when trying to join a + * conference. */ CONNECTION_ERROR: "connection.connectionError", /** diff --git a/modules/xmpp/strophe.moderate.js b/modules/xmpp/strophe.moderate.js index ae2250c5c..17d4aa23c 100644 --- a/modules/xmpp/strophe.moderate.js +++ b/modules/xmpp/strophe.moderate.js @@ -22,7 +22,8 @@ module.exports = function (XMPP, eventEmitter) { }, setMute: function (jid, mute) { logger.info("set mute", mute); - var iqToFocus = $iq({to: this.connection.emuc.focusMucJid, type: 'set'}) + var iqToFocus = $iq( + {to: this.connection.emuc.focusMucJid, type: 'set'}) .c('mute', { xmlns: 'http://jitsi.org/jitmeet/audio', jid: jid @@ -59,4 +60,4 @@ module.exports = function (XMPP, eventEmitter) { this.connection.emuc.kick(jid); } }); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/modules/xmpp/strophe.rayo.js b/modules/xmpp/strophe.rayo.js index aae5c0c44..381fcb580 100644 --- a/modules/xmpp/strophe.rayo.js +++ b/modules/xmpp/strophe.rayo.js @@ -13,7 +13,8 @@ module.exports = function() { } this.connection.addHandler( - this.onRayo.bind(this), this.RAYO_XMLNS, 'iq', 'set', null, null); + this.onRayo.bind(this), + this.RAYO_XMLNS, 'iq', 'set', null, null); }, onRayo: function (iq) { logger.info("Rayo IQ", iq); @@ -55,7 +56,7 @@ module.exports = function() { var resource = $(result).find('ref').attr('uri'); this.call_resource = resource.substr('xmpp:'.length); logger.info( - "Received call resource: " + this.call_resource); + "Received call resource: " + this.call_resource); }, function (error) { logger.info('Dial error ', error); diff --git a/modules/xmpp/strophe.util.js b/modules/xmpp/strophe.util.js index 393fef3c9..799b2d112 100644 --- a/modules/xmpp/strophe.util.js +++ b/modules/xmpp/strophe.util.js @@ -1,3 +1,4 @@ +/* global Strophe */ /** * Strophe logger implementation. Logs from level WARN and above. */