Pārlūkot izejas kodu

fix(eslint): Add dot-notation rule

dev1
hristoterezov 8 gadus atpakaļ
vecāks
revīzija
245c49bc31

+ 1
- 0
.eslintrc.js Parādīt failu

75
         'curly': 2,
75
         'curly': 2,
76
         'default-case': 0,
76
         'default-case': 0,
77
         'dot-location': [ 'error', 'property' ],
77
         'dot-location': [ 'error', 'property' ],
78
+        'dot-notation': 2,
78
         'no-caller': 2,
79
         'no-caller': 2,
79
         'no-case-declarations': 2,
80
         'no-case-declarations': 2,
80
         'no-div-regex': 0,
81
         'no-div-regex': 0,

+ 1
- 1
JitsiConference.js Parādīt failu

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

+ 1
- 1
modules/RTC/RTCUtils.js Parādīt failu

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

+ 9
- 9
modules/xmpp/ChatRoom.js Parādīt failu

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

+ 11
- 11
modules/xmpp/JingleSessionPC.js Parādīt failu

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

+ 2
- 2
modules/xmpp/xmpp.js Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt