From 7ced85e9b86abffee14644c403750a06b74c2432 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Tue, 29 Aug 2017 23:33:16 +0300 Subject: [PATCH] Dependencies and tslint rules update --- package.json | 6 +-- .../AbstractCalleeDataExtractor.ts | 2 +- .../FunctionDeclarationCalleeDataExtractor.ts | 8 ++-- .../FunctionExpressionCalleeDataExtractor.ts | 8 ++-- .../ObjectExpressionCalleeDataExtractor.ts | 16 ++++---- src/cli/JavaScriptObfuscatorCLI.ts | 2 +- src/cli/utils/CLIUtils.ts | 2 +- .../ICalleeDataExtractor.d.ts | 2 +- .../IEncodedValue.d.ts | 2 +- src/node/Nodes.ts | 2 +- .../TObjectMembersCallsChain.d.ts | 2 +- src/types/node/TNodeWithBlockStatement.d.ts | 2 +- src/types/node/TStatement.d.ts | 2 +- src/types/options/TStringArrayEncoding.d.ts | 2 +- tslint.json | 6 ++- yarn.lock | 40 +++++++++---------- 16 files changed, 52 insertions(+), 52 deletions(-) diff --git a/package.json b/package.json index 8067520a..4edd60fb 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "chalk": "2.1.0", - "chance": "1.0.10", + "chance": "1.0.11", "class-validator": "0.7.2", "commander": "2.11.0", "escodegen-wallaby": "1.6.12", @@ -48,7 +48,7 @@ "@types/md5": "2.1.32", "@types/mkdirp": "0.5.1", "@types/mocha": "2.2.42", - "@types/node": "8.0.24", + "@types/node": "8.0.25", "@types/sinon": "2.3.3", "@types/string-template": "1.0.2", "@types/webpack-env": "1.13.0", @@ -64,7 +64,7 @@ "pre-commit": "1.2.2", "sinon": "3.2.1", "ts-node": "3.3.0", - "tslint": "5.6.0", + "tslint": "5.7.0", "tslint-eslint-rules": "4.1.1", "tslint-webpack-plugin": "1.0.0", "typescript": "2.5.0", diff --git a/src/analyzers/stack-trace-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts b/src/analyzers/stack-trace-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts index 7b13a0d8..d308a001 100644 --- a/src/analyzers/stack-trace-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts +++ b/src/analyzers/stack-trace-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts @@ -12,5 +12,5 @@ export abstract class AbstractCalleeDataExtractor implements ICalleeDataExtracto * @param {Node} callee * @returns {ICalleeData} */ - public abstract extract (blockScopeBody: ESTree.Node[], callee: ESTree.Node): ICalleeData|null; + public abstract extract (blockScopeBody: ESTree.Node[], callee: ESTree.Node): ICalleeData | null; } diff --git a/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts b/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts index cfec7be7..db798fbc 100644 --- a/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts +++ b/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts @@ -16,12 +16,12 @@ export class FunctionDeclarationCalleeDataExtractor extends AbstractCalleeDataEx * @param {Identifier} callee * @returns {ICalleeData} */ - public extract (blockScopeBody: ESTree.Node[], callee: ESTree.Identifier): ICalleeData|null { + public extract (blockScopeBody: ESTree.Node[], callee: ESTree.Identifier): ICalleeData | null { if (!Node.isIdentifierNode(callee)) { return null; } - const calleeBlockStatement: ESTree.BlockStatement|null = this.getCalleeBlockStatement( + const calleeBlockStatement: ESTree.BlockStatement | null = this.getCalleeBlockStatement( NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], callee.name ); @@ -41,8 +41,8 @@ export class FunctionDeclarationCalleeDataExtractor extends AbstractCalleeDataEx * @param {string} name * @returns {BlockStatement} */ - private getCalleeBlockStatement (targetNode: ESTree.Node, name: string): ESTree.BlockStatement|null { - let calleeBlockStatement: ESTree.BlockStatement|null = null; + private getCalleeBlockStatement (targetNode: ESTree.Node, name: string): ESTree.BlockStatement | null { + let calleeBlockStatement: ESTree.BlockStatement | null = null; estraverse.traverse(targetNode, { enter: (node: ESTree.Node): any => { diff --git a/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts b/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts index f8ece407..7e77d2fd 100644 --- a/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts +++ b/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts @@ -16,8 +16,8 @@ export class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExt * @param {Identifier} callee * @returns {ICalleeData} */ - public extract (blockScopeBody: ESTree.Node[], callee: ESTree.Identifier): ICalleeData|null { - let calleeBlockStatement: ESTree.BlockStatement|null = null; + public extract (blockScopeBody: ESTree.Node[], callee: ESTree.Identifier): ICalleeData | null { + let calleeBlockStatement: ESTree.BlockStatement | null = null; if (Node.isIdentifierNode(callee)) { calleeBlockStatement = this.getCalleeBlockStatement( @@ -45,8 +45,8 @@ export class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExt * @param {string} name * @returns {BlockStatement} */ - private getCalleeBlockStatement (targetNode: ESTree.Node, name: string): ESTree.BlockStatement|null { - let calleeBlockStatement: ESTree.BlockStatement|null = null; + private getCalleeBlockStatement (targetNode: ESTree.Node, name: string): ESTree.BlockStatement | null { + let calleeBlockStatement: ESTree.BlockStatement | null = null; estraverse.traverse(targetNode, { enter: (node: ESTree.Node, parentNode: ESTree.Node): any => { diff --git a/src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts b/src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts index d9619ff7..bdecf3bf 100644 --- a/src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts +++ b/src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts @@ -18,7 +18,7 @@ export class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtra * @param {MemberExpression} callee * @returns {ICalleeData} */ - public extract (blockScopeBody: ESTree.Node[], callee: ESTree.MemberExpression): ICalleeData|null { + public extract (blockScopeBody: ESTree.Node[], callee: ESTree.MemberExpression): ICalleeData | null { if (!Node.isMemberExpressionNode(callee)) { return null; } @@ -29,8 +29,8 @@ export class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtra return null; } - const functionExpressionName: string|number|null = objectMembersCallsChain[objectMembersCallsChain.length - 1]; - const calleeBlockStatement: ESTree.BlockStatement|null = this.getCalleeBlockStatement( + const functionExpressionName: string | number | null = objectMembersCallsChain[objectMembersCallsChain.length - 1]; + const calleeBlockStatement: ESTree.BlockStatement | null = this.getCalleeBlockStatement( NodeUtils.getBlockScopesOfNode(blockScopeBody[0])[0], objectMembersCallsChain ); @@ -91,14 +91,14 @@ export class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtra private getCalleeBlockStatement ( targetNode: ESTree.Node, objectMembersCallsChain: TObjectMembersCallsChain - ): ESTree.BlockStatement|null { - const objectName: string|number|undefined = objectMembersCallsChain.shift(); + ): ESTree.BlockStatement | null { + const objectName: string | number | undefined = objectMembersCallsChain.shift(); if (!objectName) { return null; } - let calleeBlockStatement: ESTree.BlockStatement|null = null; + let calleeBlockStatement: ESTree.BlockStatement | null = null; estraverse.traverse(targetNode, { enter: (node: ESTree.Node, parentNode: ESTree.Node): any => { @@ -127,8 +127,8 @@ export class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtra private findCalleeBlockStatement ( objectExpressionProperties: ESTree.Property[], objectMembersCallsChain: TObjectMembersCallsChain - ): ESTree.BlockStatement|null { - const nextItemInCallsChain: string|number|undefined = objectMembersCallsChain.shift(); + ): ESTree.BlockStatement | null { + const nextItemInCallsChain: string | number | undefined = objectMembersCallsChain.shift(); if (!nextItemInCallsChain) { return null; diff --git a/src/cli/JavaScriptObfuscatorCLI.ts b/src/cli/JavaScriptObfuscatorCLI.ts index d8d43d54..65957873 100644 --- a/src/cli/JavaScriptObfuscatorCLI.ts +++ b/src/cli/JavaScriptObfuscatorCLI.ts @@ -107,7 +107,7 @@ export class JavaScriptObfuscatorCLI implements IInitializable { */ private buildOptions (): TInputOptions { const inputCLIOptions: TInputOptions = JavaScriptObfuscatorCLI.filterOptions(this.inputCLIOptions); - const configFilePath: string|undefined = this.inputCLIOptions.config; + const configFilePath: string | undefined = this.inputCLIOptions.config; const configFileLocation: string = configFilePath ? path.resolve(configFilePath, '.') : ''; const configFileOptions: TInputOptions = configFileLocation ? CLIUtils.getUserConfig(configFileLocation) : {}; diff --git a/src/cli/utils/CLIUtils.ts b/src/cli/utils/CLIUtils.ts index 8bc9f19a..54445430 100644 --- a/src/cli/utils/CLIUtils.ts +++ b/src/cli/utils/CLIUtils.ts @@ -24,7 +24,7 @@ export class CLIUtils { * @param {string} inputPath * @returns {string} */ - public static getOutputCodePath (outputPath: string|undefined, inputPath: string): string { + public static getOutputCodePath (outputPath: string | undefined, inputPath: string): string { if (outputPath) { return outputPath; } diff --git a/src/interfaces/analyzers/stack-trace-analyzer/ICalleeDataExtractor.d.ts b/src/interfaces/analyzers/stack-trace-analyzer/ICalleeDataExtractor.d.ts index 5a9d83a1..95324ba7 100644 --- a/src/interfaces/analyzers/stack-trace-analyzer/ICalleeDataExtractor.d.ts +++ b/src/interfaces/analyzers/stack-trace-analyzer/ICalleeDataExtractor.d.ts @@ -8,5 +8,5 @@ export interface ICalleeDataExtractor { * @param callee * @returns ICalleeData|null */ - extract (blockScopeBody: ESTree.Node[], callee: ESTree.Node): ICalleeData|null; + extract (blockScopeBody: ESTree.Node[], callee: ESTree.Node): ICalleeData | null; } diff --git a/src/interfaces/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/IEncodedValue.d.ts b/src/interfaces/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/IEncodedValue.d.ts index 03954456..4cf96404 100644 --- a/src/interfaces/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/IEncodedValue.d.ts +++ b/src/interfaces/node-transformers/obfuscating-transformers/obfuscating-replacers/literal-obfuscating-replacers/IEncodedValue.d.ts @@ -1,4 +1,4 @@ export interface IEncodedValue { encodedValue: string; - key: string|null; + key: string | null; } diff --git a/src/node/Nodes.ts b/src/node/Nodes.ts index 382cb0bd..3c91b8ed 100644 --- a/src/node/Nodes.ts +++ b/src/node/Nodes.ts @@ -250,7 +250,7 @@ export class Nodes { * @param {string} raw * @returns {Literal} */ - public static getLiteralNode (value: boolean|number|string, raw?: string): ESTree.Literal { + public static getLiteralNode (value: boolean | number | string, raw?: string): ESTree.Literal { raw = raw !== undefined ? raw : `'${value}'`; return { diff --git a/src/types/analyzers/stack-trace-analyzer/TObjectMembersCallsChain.d.ts b/src/types/analyzers/stack-trace-analyzer/TObjectMembersCallsChain.d.ts index 8f14c018..8713f65b 100644 --- a/src/types/analyzers/stack-trace-analyzer/TObjectMembersCallsChain.d.ts +++ b/src/types/analyzers/stack-trace-analyzer/TObjectMembersCallsChain.d.ts @@ -1 +1 @@ -export type TObjectMembersCallsChain = (string|number)[]; +export type TObjectMembersCallsChain = (string | number)[]; diff --git a/src/types/node/TNodeWithBlockStatement.d.ts b/src/types/node/TNodeWithBlockStatement.d.ts index 07a38285..82266bac 100644 --- a/src/types/node/TNodeWithBlockStatement.d.ts +++ b/src/types/node/TNodeWithBlockStatement.d.ts @@ -1,3 +1,3 @@ import * as ESTree from 'estree'; -export type TNodeWithBlockStatement = ESTree.BlockStatement|ESTree.Program; +export type TNodeWithBlockStatement = ESTree.BlockStatement | ESTree.Program; diff --git a/src/types/node/TStatement.d.ts b/src/types/node/TStatement.d.ts index 7fbf5b32..62b1796f 100644 --- a/src/types/node/TStatement.d.ts +++ b/src/types/node/TStatement.d.ts @@ -1,3 +1,3 @@ import * as ESTree from 'estree'; -export type TStatement = ESTree.Statement|ESTree.ModuleDeclaration; +export type TStatement = ESTree.Statement | ESTree.ModuleDeclaration; diff --git a/src/types/options/TStringArrayEncoding.d.ts b/src/types/options/TStringArrayEncoding.d.ts index 5f0d2d45..88bc8c96 100644 --- a/src/types/options/TStringArrayEncoding.d.ts +++ b/src/types/options/TStringArrayEncoding.d.ts @@ -1 +1 @@ -export type TStringArrayEncoding = boolean|'base64'|'rc4'; +export type TStringArrayEncoding = boolean | 'base64' | 'rc4'; diff --git a/tslint.json b/tslint.json index 2f4d4ad3..d98d577e 100644 --- a/tslint.json +++ b/tslint.json @@ -82,6 +82,7 @@ "no-multi-spaces": [true], "no-null-keyword": false, "no-parameter-properties": true, + "no-parameter-reassignment": false, "no-reference": true, "no-reference-import": true, "no-regex-spaces": true, @@ -89,6 +90,7 @@ "no-shadowed-variable": true, "no-string-literal": true, "no-string-throw": true, + "no-submodule-imports": true, "no-switch-case-fall-through": false, "no-trailing-whitespace": false, "no-unnecessary-callback-wrapper": true, @@ -184,7 +186,9 @@ "check-decl", "check-operator", "check-separator", - "check-type" + "check-type", + "check-type-operator", + "check-rest-spread" ] } } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index df53431f..c08fe75b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -56,10 +56,14 @@ version "2.2.42" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.42.tgz#ab769f51d37646b6fe8d4a086a98c285b1fab3f5" -"@types/node@*", "@types/node@8.0.24": +"@types/node@*": version "8.0.24" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.24.tgz#06c580084d9add1fb40c1510ef0b448961246fb1" +"@types/node@8.0.25": + version "8.0.25" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.25.tgz#66ecaf4df93f5281b48427ee96fbcdfc4f0cdce1" + "@types/sinon@2.3.3": version "2.3.3" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-2.3.3.tgz#1f20b96f954b4997a09c1c0a20264aaba6b00147" @@ -298,15 +302,7 @@ babel-cli@6.26.0: optionalDependencies: chokidar "^1.6.1" -babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-code-frame@^6.26.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -943,7 +939,7 @@ chai@4.1.1: pathval "^1.0.0" type-detect "^4.0.0" -chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -961,9 +957,9 @@ chalk@2.1.0, chalk@^2.0.0, chalk@^2.1.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" -chance@1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/chance/-/chance-1.0.10.tgz#03500b04ad94e778dd2891b09ec73a6ad87b1996" +chance@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/chance/-/chance-1.0.11.tgz#48e82f7583df356053e0ad122d4654c5066c570d" charenc@~0.0.1: version "0.0.2" @@ -3831,15 +3827,15 @@ tslint-eslint-rules@4.1.1: tslib "^1.0.0" tsutils "^1.4.0" -tslint-webpack-plugin@^1.0.0: +tslint-webpack-plugin@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/tslint-webpack-plugin/-/tslint-webpack-plugin-1.0.0.tgz#c3fdf3b29e77ae4f54e6981b3a85a65909f39ec9" dependencies: chalk "^2.1.0" -tslint@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.6.0.tgz#088aa6c6026623338650b2900828ab3edf59f6cf" +tslint@5.7.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.7.0.tgz#c25e0d0c92fa1201c2bc30e844e08e682b4f3552" dependencies: babel-code-frame "^6.22.0" colors "^1.1.2" @@ -3850,15 +3846,15 @@ tslint@5.6.0: resolve "^1.3.2" semver "^5.3.0" tslib "^1.7.1" - tsutils "^2.7.1" + tsutils "^2.8.1" tsutils@^1.4.0: version "1.9.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.9.1.tgz#b9f9ab44e55af9681831d5f28d0aeeaf5c750cb0" -tsutils@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.8.0.tgz#0160173729b3bf138628dd14a1537e00851d814a" +tsutils@^2.8.1: + version "2.8.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.8.2.tgz#2c1486ba431260845b0ac6f902afd9d708a8ea6a" dependencies: tslib "^1.7.1"