Browse Source

Dependencies update. Updated tslint rules.

sanex3339 8 years ago
parent
commit
3e47682d4f
9 changed files with 28 additions and 22 deletions
  1. 3 1
      dist/index.js
  2. 5 5
      package.json
  3. 1 1
      scripts/tslint
  4. 1 1
      src/SourceMapCorrector.ts
  5. 1 1
      src/node/NodeUtils.ts
  6. 2 3
      src/utils/CryptUtils.ts
  7. 9 9
      tsconfig.json
  8. 5 0
      tslint.json
  9. 1 1
      webpack.config.js

+ 3 - 1
dist/index.js

@@ -1703,6 +1703,7 @@ var _createClass = (function () { function defineProperties(target, props) { for
 
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
+Object.defineProperty(exports, "__esModule", { value: true });
 var RandomGeneratorUtils_1 = __webpack_require__(4);
 var RandomGeneratorUtils_1 = __webpack_require__(4);
 var Utils_1 = __webpack_require__(8);
 var Utils_1 = __webpack_require__(8);
 
 
@@ -1751,7 +1752,7 @@ var CryptUtils = function () {
                 length: length,
                 length: length,
                 pool: RandomGeneratorUtils_1.RandomGeneratorUtils.randomGeneratorPool
                 pool: RandomGeneratorUtils_1.RandomGeneratorUtils.randomGeneratorPool
             });
             });
-            var randomStringDiff = randomString.replace(new RegExp('[' + escapeRegExp(str) + ']', 'g'), '');
+            var randomStringDiff = randomString.replace(new RegExp("[" + escapeRegExp(str) + "]", 'g'), '');
             var randomStringDiffArray = randomStringDiff.split('');
             var randomStringDiffArray = randomStringDiff.split('');
             RandomGeneratorUtils_1.RandomGeneratorUtils.getRandomGenerator().shuffle(randomStringDiffArray);
             RandomGeneratorUtils_1.RandomGeneratorUtils.getRandomGenerator().shuffle(randomStringDiffArray);
             randomStringDiff = randomStringDiffArray.join('');
             randomStringDiff = randomStringDiffArray.join('');
@@ -2357,6 +2358,7 @@ var _createClass = (function () { function defineProperties(target, props) { for
 
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
 
+Object.defineProperty(exports, "__esModule", { value: true });
 var tslib_1 = __webpack_require__(1);
 var tslib_1 = __webpack_require__(1);
 var inversify_1 = __webpack_require__(0);
 var inversify_1 = __webpack_require__(0);
 var ServiceIdentifiers_1 = __webpack_require__(2);
 var ServiceIdentifiers_1 = __webpack_require__(2);

+ 5 - 5
package.json

@@ -34,7 +34,7 @@
     "tslib": "1.6.0"
     "tslib": "1.6.0"
   },
   },
   "devDependencies": {
   "devDependencies": {
-    "@types/chai": "3.4.35",
+    "@types/chai": "3.5.0",
     "@types/chance": "0.7.32",
     "@types/chance": "0.7.32",
     "@types/commander": "2.3.31",
     "@types/commander": "2.3.31",
     "@types/escodegen": "0.0.6",
     "@types/escodegen": "0.0.6",
@@ -47,18 +47,18 @@
     "@types/sinon": "2.1.2",
     "@types/sinon": "2.1.2",
     "@types/string-template": "1.0.2",
     "@types/string-template": "1.0.2",
     "awesome-typescript-loader": "3.1.2",
     "awesome-typescript-loader": "3.1.2",
-    "babel-cli": "6.24.0",
+    "babel-cli": "6.24.1",
     "babel-loader": "6.4.1",
     "babel-loader": "6.4.1",
     "babel-plugin-array-includes": "2.0.3",
     "babel-plugin-array-includes": "2.0.3",
-    "babel-preset-es2015": "6.24.0",
+    "babel-preset-es2015": "6.24.1",
     "chai": "4.0.0-canary.1",
     "chai": "4.0.0-canary.1",
     "coveralls": "2.13.0",
     "coveralls": "2.13.0",
     "istanbul": "1.1.0-alpha.1",
     "istanbul": "1.1.0-alpha.1",
     "mocha": "3.2.0",
     "mocha": "3.2.0",
     "sinon": "2.1.0",
     "sinon": "2.1.0",
     "ts-node": "3.0.2",
     "ts-node": "3.0.2",
-    "tslint": "4.5.1",
-    "tslint-loader": "3.4.3",
+    "tslint": "5.1.0",
+    "tslint-loader": "3.5.2",
     "typescript": "2.3.0",
     "typescript": "2.3.0",
     "webpack": "2.3.3",
     "webpack": "2.3.3",
     "webpack-node-externals": "1.5.4"
     "webpack-node-externals": "1.5.4"

+ 1 - 1
scripts/tslint

@@ -1,3 +1,3 @@
 #!/bin/bash
 #!/bin/bash
 
 
-$(yarn bin)/tslint src/**/*.ts
+$(yarn bin)/tslint src/**/*.ts --type-check --project tsconfig.json

+ 1 - 1
src/SourceMapCorrector.ts

@@ -79,5 +79,5 @@ export class SourceMapCorrector implements ISourceMapCorrector {
         }
         }
 
 
         return `${obfuscatedCode}\n${sourceMappingUrl}`;
         return `${obfuscatedCode}\n${sourceMappingUrl}`;
-    };
+    }
 }
 }

+ 1 - 1
src/node/NodeUtils.ts

@@ -73,7 +73,7 @@ export class NodeUtils {
         };
         };
 
 
         return NodeUtils.parentize(cloneRecursive(astTree));
         return NodeUtils.parentize(cloneRecursive(astTree));
-    };
+    }
 
 
     /**
     /**
      * @param code
      * @param code

+ 2 - 3
src/utils/CryptUtils.ts

@@ -42,7 +42,7 @@ export class CryptUtils {
         const escapeRegExp: (s: string) => string = (s: string) =>
         const escapeRegExp: (s: string) => string = (s: string) =>
             s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
             s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
 
 
-        const randomMerge: (s1: string, s2: string) => string = function (s1: string, s2: string): string {
+        const randomMerge: (s1: string, s2: string) => string = (s1: string, s2: string): string => {
             let i1: number = -1,
             let i1: number = -1,
                 i2: number = -1,
                 i2: number = -1,
                 result: string = '';
                 result: string = '';
@@ -64,7 +64,7 @@ export class CryptUtils {
         });
         });
 
 
         let randomStringDiff: string = randomString.replace(
         let randomStringDiff: string = randomString.replace(
-            new RegExp('[' + escapeRegExp(str) + ']', 'g'),
+            new RegExp(`[${escapeRegExp(str)}]`, 'g'),
             '');
             '');
 
 
         const randomStringDiffArray: string[] = randomStringDiff.split('');
         const randomStringDiffArray: string[] = randomStringDiff.split('');
@@ -73,7 +73,6 @@ export class CryptUtils {
         randomStringDiff = randomStringDiffArray.join('');
         randomStringDiff = randomStringDiffArray.join('');
 
 
         return [randomMerge(str, randomStringDiff), randomStringDiff];
         return [randomMerge(str, randomStringDiff), randomStringDiff];
-
     }
     }
 
 
     /**
     /**

+ 9 - 9
tsconfig.json

@@ -1,19 +1,19 @@
 {
 {
   "compilerOptions": {
   "compilerOptions": {
-    "target": "ES6",
+    "emitDecoratorMetadata": true,
+    "experimentalDecorators": true,
+    "importHelpers": true,
     "lib": [
     "lib": [
       "es2017",
       "es2017",
       "DOM"
       "DOM"
     ],
     ],
-    "noEmitHelpers": true,
-    "importHelpers": true,
     "module": "commonjs",
     "module": "commonjs",
-    "sourceMap": true,
-    "emitDecoratorMetadata": true,
-    "experimentalDecorators": true,
+    "noEmitHelpers": true,
+    "noImplicitThis": false,
+    "noUnusedLocals": true,
     "removeComments": true,
     "removeComments": true,
-    "noImplicitAny": true,
-    "strictNullChecks": true,
-    "noUnusedLocals": true
+    "sourceMap": true,
+    "strict": true,
+    "target": "ES6"
   }
   }
 }
 }

+ 5 - 0
tslint.json

@@ -63,15 +63,18 @@
     "no-inferrable-types": false,
     "no-inferrable-types": false,
     "no-internal-module": true,
     "no-internal-module": true,
     "no-invalid-this": true,
     "no-invalid-this": true,
+    "no-misused-new": true,
     "no-null-keyword": false,
     "no-null-keyword": false,
     "no-parameter-properties": true,
     "no-parameter-properties": true,
     "no-reference": true,
     "no-reference": true,
+    "no-reference-import": true,
     "no-require-imports": false,
     "no-require-imports": false,
     "no-shadowed-variable": true,
     "no-shadowed-variable": true,
     "no-string-literal": true,
     "no-string-literal": true,
     "no-string-throw": true,
     "no-string-throw": true,
     "no-switch-case-fall-through": false,
     "no-switch-case-fall-through": false,
     "no-trailing-whitespace": false,
     "no-trailing-whitespace": false,
+    "no-unnecessary-callback-wrapper": true,
     "no-unused-expression": true,
     "no-unused-expression": true,
     "no-use-before-declare": true,
     "no-use-before-declare": true,
     "no-var-keyword": true,
     "no-var-keyword": true,
@@ -86,7 +89,9 @@
       "check-whitespace"
       "check-whitespace"
     ],
     ],
     "one-variable-per-declaration": false,
     "one-variable-per-declaration": false,
+    "only-arrow-functions": [true, "allow-declarations"],
     "prefer-const": true,
     "prefer-const": true,
+    "prefer-template": true,
     "quotemark": false,
     "quotemark": false,
     "radix": true,
     "radix": true,
     "semicolon": [true, "always"],
     "semicolon": [true, "always"],

+ 1 - 1
webpack.config.js

@@ -23,7 +23,7 @@ module.exports = {
                 enforce: 'pre',
                 enforce: 'pre',
                 test: /\.ts$/,
                 test: /\.ts$/,
                 loader: 'tslint-loader',
                 loader: 'tslint-loader',
-                exclude: /(node_modules)/,
+                exclude: /(node_modules)/
             },
             },
             {
             {
                 test: /\.ts(x?)$/,
                 test: /\.ts(x?)$/,