浏览代码

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

dev1
hristoterezov 8 年前
父节点
当前提交
70c4748cfa
共有 3 个文件被更改,包括 13 次插入21 次删除
  1. 6
    14
      .eslintrc.js
  2. 4
    4
      modules/RTC/ScreenObtainer.js
  3. 3
    3
      modules/xmpp/ChatRoom.js

+ 6
- 14
.eslintrc.js 查看文件

14
         '__filename': false
14
         '__filename': false
15
     },
15
     },
16
     'parserOptions': {
16
     'parserOptions': {
17
+        'ecmaFeatures': {
18
+            'experimentalObjectRestSpread': true
19
+        },
17
         'sourceType': 'module'
20
         'sourceType': 'module'
18
     },
21
     },
19
     'rules': {
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 查看文件

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

+ 3
- 3
modules/xmpp/ChatRoom.js 查看文件

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

正在加载...
取消
保存