Sfoglia il codice sorgente

fix(eslint): Add dot-notation rule

dev1
hristoterezov 8 anni fa
parent
commit
245c49bc31

+ 1
- 0
.eslintrc.js Vedi File

@@ -75,6 +75,7 @@ module.exports = {
75 75
         'curly': 2,
76 76
         'default-case': 0,
77 77
         'dot-location': [ 'error', 'property' ],
78
+        'dot-notation': 2,
78 79
         'no-caller': 2,
79 80
         'no-case-declarations': 2,
80 81
         'no-div-regex': 0,

+ 1
- 1
JitsiConference.js Vedi File

@@ -1035,7 +1035,7 @@ JitsiConference.prototype.onIncomingCall
1035 1035
     // add info whether call is cross-region
1036 1036
     var crossRegion = null;
1037 1037
     if (window.jitsiRegionInfo) {
1038
-        crossRegion = window.jitsiRegionInfo['CrossRegion'];
1038
+        crossRegion = window.jitsiRegionInfo.CrossRegion;
1039 1039
     }
1040 1040
     Statistics.analytics.sendEvent(
1041 1041
         'session.initiate', {

+ 1
- 1
modules/RTC/RTCUtils.js Vedi File

@@ -1014,7 +1014,7 @@ class RTCUtils extends Listenable {
1014 1014
                 };
1015 1015
 
1016 1016
                 if(screenObtainer.isSupported()) {
1017
-                    deviceGUM['desktop'] = screenObtainer.obtainStream.bind(
1017
+                    deviceGUM.desktop = screenObtainer.obtainStream.bind(
1018 1018
                         screenObtainer,
1019 1019
                         dsOptions);
1020 1020
                 }

+ 9
- 9
modules/xmpp/ChatRoom.js Vedi File

@@ -95,10 +95,10 @@ export default class ChatRoom extends Listenable {
95 95
     }
96 96
 
97 97
     initPresenceMap() {
98
-        this.presMap['to'] = this.myroomjid;
99
-        this.presMap['xns'] = 'http://jabber.org/protocol/muc';
100
-        this.presMap['nodes'] = [];
101
-        this.presMap['nodes'].push({
98
+        this.presMap.to = this.myroomjid;
99
+        this.presMap.xns = 'http://jabber.org/protocol/muc';
100
+        this.presMap.nodes = [];
101
+        this.presMap.nodes.push({
102 102
             'tagName': 'user-agent',
103 103
             'value': navigator.userAgent,
104 104
             'attributes': {xmlns: 'http://jitsi.org/jitmeet/user-agent'}
@@ -109,7 +109,7 @@ export default class ChatRoom extends Listenable {
109 109
     }
110 110
 
111 111
     updateDeviceAvailability(devices) {
112
-        this.presMap['nodes'].push({
112
+        this.presMap.nodes.push({
113 113
             'tagName': 'devices',
114 114
             'children': [
115 115
                 {
@@ -133,7 +133,7 @@ export default class ChatRoom extends Listenable {
133 133
     }
134 134
 
135 135
     sendPresence(fromJoin) {
136
-        var to = this.presMap['to'];
136
+        var to = this.presMap.to;
137 137
         if (!to || (!this.joined && !fromJoin)) {
138 138
             // Too early to send presence - not initialized
139 139
             return;
@@ -147,7 +147,7 @@ export default class ChatRoom extends Listenable {
147 147
         // as joining, and server can send us the message history for the room on
148 148
         // every presence
149 149
         if (fromJoin) {
150
-            pres.c('x', {xmlns: this.presMap['xns']});
150
+            pres.c('x', {xmlns: this.presMap.xns});
151 151
 
152 152
             if (this.password) {
153 153
                 pres.c('password').t(this.password).up();
@@ -774,14 +774,14 @@ export default class ChatRoom extends Listenable {
774 774
             const videoTypeNode = filterNodeFromPresenceJSON(pres, 'videoType');
775 775
 
776 776
             if(videoTypeNode.length > 0) {
777
-                data.videoType = videoTypeNode[0]['value'];
777
+                data.videoType = videoTypeNode[0].value;
778 778
             }
779 779
         } else {
780 780
             logger.error('Unsupported media type: ' + mediaType);
781 781
             return null;
782 782
         }
783 783
 
784
-        data.muted = mutedNode.length > 0 && mutedNode[0]['value'] === 'true';
784
+        data.muted = mutedNode.length > 0 && mutedNode[0].value === 'true';
785 785
 
786 786
         return data;
787 787
     }

+ 11
- 11
modules/xmpp/JingleSessionPC.js Vedi File

@@ -903,7 +903,7 @@ export default class JingleSessionPC extends JingleSession {
903 903
                             this.peerconnection.setLocalDescription(
904 904
                                 answer,
905 905
                                 () => {
906
-                                    resolve(); 
906
+                                    resolve();
907 907
                                 },
908 908
                                 error => {
909 909
                                     reject(
@@ -912,13 +912,13 @@ export default class JingleSessionPC extends JingleSession {
912 912
                             );
913 913
                         },
914 914
                         error => {
915
-                            reject('createAnswer failed: ' + error); 
915
+                            reject('createAnswer failed: ' + error);
916 916
                         },
917 917
                         media_constraints
918 918
                     );
919 919
                 },
920 920
                 error => {
921
-                    reject('setRemoteDescription failed: ' + error); 
921
+                    reject('setRemoteDescription failed: ' + error);
922 922
                 }
923 923
             );
924 924
         });
@@ -1444,8 +1444,8 @@ export default class JingleSessionPC extends JingleSession {
1444 1444
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1445 1445
      */
1446 1446
     fixSourceAddJingle(jingle) {
1447
-        let ssrcs = this.modifiedSSRCs['unmute'];
1448
-        this.modifiedSSRCs['unmute'] = [];
1447
+        let ssrcs = this.modifiedSSRCs.unmute;
1448
+        this.modifiedSSRCs.unmute = [];
1449 1449
         if (ssrcs && ssrcs.length) {
1450 1450
             ssrcs.forEach(function(ssrcObj) {
1451 1451
                 const desc = $(jingle.tree()).find('>jingle>content[name="'
@@ -1467,8 +1467,8 @@ export default class JingleSessionPC extends JingleSession {
1467 1467
             });
1468 1468
         }
1469 1469
 
1470
-        ssrcs = this.modifiedSSRCs['addMuted'];
1471
-        this.modifiedSSRCs['addMuted'] = [];
1470
+        ssrcs = this.modifiedSSRCs.addMuted;
1471
+        this.modifiedSSRCs.addMuted = [];
1472 1472
         if (ssrcs && ssrcs.length) {
1473 1473
             ssrcs.forEach(function(ssrcObj) {
1474 1474
                 const desc
@@ -1514,8 +1514,8 @@ export default class JingleSessionPC extends JingleSession {
1514 1514
      * @returns {boolean} true if the jingle has to be sent and false otherwise.
1515 1515
      */
1516 1516
     fixSourceRemoveJingle(jingle) {
1517
-        let ssrcs = this.modifiedSSRCs['mute'];
1518
-        this.modifiedSSRCs['mute'] = [];
1517
+        let ssrcs = this.modifiedSSRCs.mute;
1518
+        this.modifiedSSRCs.mute = [];
1519 1519
         if (ssrcs && ssrcs.length) {
1520 1520
             ssrcs.forEach(function(ssrcObj) {
1521 1521
                 ssrcObj.ssrcs.forEach(function(ssrc) {
@@ -1537,8 +1537,8 @@ export default class JingleSessionPC extends JingleSession {
1537 1537
             });
1538 1538
         }
1539 1539
 
1540
-        ssrcs = this.modifiedSSRCs['remove'];
1541
-        this.modifiedSSRCs['remove'] = [];
1540
+        ssrcs = this.modifiedSSRCs.remove;
1541
+        this.modifiedSSRCs.remove = [];
1542 1542
         if (ssrcs && ssrcs.length) {
1543 1543
             ssrcs.forEach(function(ssrcObj) {
1544 1544
                 const desc

+ 2
- 2
modules/xmpp/xmpp.js Vedi File

@@ -93,7 +93,7 @@ export default class XMPP extends Listenable {
93 93
     }
94 94
 
95 95
     getConnection() {
96
-        return this.connection; 
96
+        return this.connection;
97 97
     }
98 98
 
99 99
     /**
@@ -237,7 +237,7 @@ export default class XMPP extends Listenable {
237 237
      * @param options {object} connecting options - rid, sid, jid and password.
238 238
      */
239 239
     attach(options) {
240
-        const now = this.connectionTimes['attaching'] = window.performance.now();
240
+        const now = this.connectionTimes.attaching = window.performance.now();
241 241
         logger.log('(TIME) Strophe Attaching\t:' + now);
242 242
         this.connection.attach(options.jid, options.sid,
243 243
             parseInt(options.rid,10) + 1,

Loading…
Annulla
Salva