소스 검색

[eslint] no-throw-literal

dev1
Lyubo Marinov 8 년 전
부모
커밋
f4e0e87abe
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    0
      .eslintrc.js
  2. 3
    1
      modules/statistics/RTPStatsCollector.js

+ 1
- 0
.eslintrc.js 파일 보기

@@ -115,6 +115,7 @@ module.exports = {
115 115
         'no-self-assign': 2,
116 116
         'no-self-compare': 2,
117 117
         'no-sequences': 2,
118
+        'no-throw-literal': 2,
118 119
         'no-unmodified-loop-condition': 2,
119 120
         'no-unused-expressions': [
120 121
             'error',

+ 3
- 1
modules/statistics/RTPStatsCollector.js 파일 보기

@@ -186,6 +186,7 @@ function StatsCollector(
186 186
     const keys = KEYS_BY_BROWSER_TYPE[this._browserType];
187 187
 
188 188
     if (!keys) {
189
+        // eslint-disable-next-line no-throw-literal
189 190
         throw `The browser type '${this._browserType}' isn't supported!`;
190 191
     }
191 192
 
@@ -328,8 +329,9 @@ StatsCollector.prototype._defineGetStatValueMethod = function(keys) {
328 329
         if (key) {
329 330
             return key;
330 331
         }
331
-        throw `The property '${name}' isn't supported!`;
332 332
 
333
+        // eslint-disable-next-line no-throw-literal
334
+        throw `The property '${name}' isn't supported!`;
333 335
     };
334 336
 
335 337
     // Define the function which retrieves the value from a specific report

Loading…
취소
저장