Quellcode durchsuchen

fix(eslint): Changes eslint existing rules to match the same rules in jitsi meet

dev1
hristoterezov vor 8 Jahren
Ursprung
Commit
70c4748cfa
3 geänderte Dateien mit 13 neuen und 21 gelöschten Zeilen
  1. 6
    14
      .eslintrc.js
  2. 4
    4
      modules/RTC/ScreenObtainer.js
  3. 3
    3
      modules/xmpp/ChatRoom.js

+ 6
- 14
.eslintrc.js Datei anzeigen

@@ -14,22 +14,14 @@ module.exports = {
14 14
         '__filename': false
15 15
     },
16 16
     'parserOptions': {
17
+        'ecmaFeatures': {
18
+            'experimentalObjectRestSpread': true
19
+        },
17 20
         'sourceType': 'module'
18 21
     },
19 22
     'rules': {
20
-        'new-cap': [
21
-            'error',
22
-            {
23
-                'capIsNew': false // Behave like JSHint's newcap.
24
-            }
25
-        ],
26
-        // While it is considered a best practice to avoid using methods on
27
-        // console in JavaScript that is designed to be executed in the browser
28
-        // and ESLint includes the rule among its set of recommended rules, (1)
29
-        // the general practice is to strip such calls before pushing to
30
-        // production and (2) we prefer to utilize console in lib-jitsi-meet
31
-        // (and jitsi-meet).
32
-        'no-console': 'off',
33
-        'semi': 'error'
23
+        'new-cap': 2,
24
+        'no-console': 0,
25
+        'semi': [ 'error', 'always' ]
34 26
     }
35 27
 };

+ 4
- 4
modules/RTC/ScreenObtainer.js Datei anzeigen

@@ -33,7 +33,7 @@ var firefoxExtInstalled = null;
33 33
  */
34 34
 var reDetectFirefoxExtension = false;
35 35
 
36
-var GUM = null;
36
+var gumFunction = null;
37 37
 
38 38
 /**
39 39
  * The error returned by chrome when trying to start inline installation from
@@ -71,7 +71,7 @@ var ScreenObtainer = {
71 71
     init(options, gum) {
72 72
         var obtainDesktopStream = null;
73 73
         this.options = options = options || {};
74
-        GUM = gum;
74
+        gumFunction = gum;
75 75
 
76 76
         if (RTCBrowserType.isFirefox())
77 77
             initFirefoxExtensionDetection(options);
@@ -322,7 +322,7 @@ var ScreenObtainer = {
322 322
  * 'about:config'.
323 323
  */
324 324
 function obtainWebRTCScreen(options, streamCallback, failCallback) {
325
-    GUM(['screen'], streamCallback, failCallback);
325
+    gumFunction(['screen'], streamCallback, failCallback);
326 326
 }
327 327
 
328 328
 /**
@@ -502,7 +502,7 @@ function waitForExtensionAfterInstall(options, waitInterval, retries) {
502 502
  */
503 503
 function onGetStreamResponse(response, onSuccess, onFailure) {
504 504
     if (response.streamId) {
505
-        GUM(
505
+        gumFunction(
506 506
             ['desktop'],
507 507
             stream => onSuccess(stream),
508 508
             onFailure,

+ 3
- 3
modules/xmpp/ChatRoom.js Datei anzeigen

@@ -30,7 +30,7 @@ var parser = {
30 30
             self.packet2JSON($(this), node.children);
31 31
         });
32 32
     },
33
-    JSON2packet: function (nodes, packet) {
33
+    json2packet: function (nodes, packet) {
34 34
         for(let i = 0; i < nodes.length; i++) {
35 35
             const node = nodes[i];
36 36
             if(!node || node === null){
@@ -40,7 +40,7 @@ var parser = {
40 40
             if(node.value)
41 41
                 packet.t(node.value);
42 42
             if(node.children)
43
-                this.JSON2packet(node.children, packet);
43
+                this.json2packet(node.children, packet);
44 44
             packet.up();
45 45
         }
46 46
         // packet.up();
@@ -151,7 +151,7 @@ export default class ChatRoom extends Listenable {
151 151
             pres.up();
152 152
         }
153 153
 
154
-        parser.JSON2packet(this.presMap.nodes, pres);
154
+        parser.json2packet(this.presMap.nodes, pres);
155 155
         this.connection.send(pres);
156 156
         if (fromJoin) {
157 157
             // XXX We're pressed for time here because we're beginning a complex

Laden…
Abbrechen
Speichern