Jelajahi Sumber

Update to typescript 3.0.1

sanex3339 6 tahun lalu
induk
melakukan
a697e64bca

+ 1 - 1
package.json

@@ -76,7 +76,7 @@
     "tslint-language-service": "0.9.9",
     "tslint-microsoft-contrib": "5.1.0",
     "tslint-webpack-plugin": "1.2.2",
-    "typescript": "2.9.2",
+    "typescript": "3.0.1",
     "webpack": "4.16.3",
     "webpack-cli": "3.1.0",
     "webpack-node-externals": "1.7.2"

+ 2 - 2
src/custom-nodes/AbstractCustomNode.ts

@@ -59,9 +59,9 @@ export abstract class AbstractCustomNode implements ICustomNode {
     }
 
     /**
-     * @param {any[]} args
+     * @param {unknown[]} args
      */
-    public abstract initialize (...args: any[]): void;
+    public abstract initialize (...args: unknown[]): void;
 
     /**
      * @returns {TStatement[]}

+ 2 - 2
src/interfaces/IInitializable.d.ts

@@ -1,8 +1,8 @@
-export interface IInitializable {
+export interface IInitializable <T extends any[] = never[]> {
     [key: string]: any;
 
     /**
      * @param args
      */
-    initialize (...args: any[]): void;
+    initialize (...args: T): void;
 }

+ 1 - 1
src/interfaces/custom-nodes/ICustomNode.d.ts

@@ -2,7 +2,7 @@ import { TStatement } from '../../types/node/TStatement';
 
 import { IInitializable } from '../IInitializable';
 
-export interface ICustomNode extends IInitializable {
+export interface ICustomNode extends IInitializable<any[]> {
     /**
      * @returns ESTree.Node[]
      */

+ 1 - 1
src/interfaces/source-code/IObfuscatedCode.d.ts

@@ -1,6 +1,6 @@
 import { IInitializable } from '../IInitializable';
 
-export interface IObfuscatedCode extends IInitializable {
+export interface IObfuscatedCode extends IInitializable <[string, string]> {
     /**
      * @return {string}
      */

+ 0 - 5
src/interfaces/storages/IArrayStorage.d.ts

@@ -28,11 +28,6 @@ export interface IArrayStorage <V> extends IInitializable {
      */
     getStorageId (): string;
 
-    /**
-     * @param args
-     */
-    initialize (...args: any[]): void;
-
     /**
      * @param storage
      * @param mergeId

+ 0 - 5
src/interfaces/storages/IMapStorage.d.ts

@@ -34,11 +34,6 @@ export interface IMapStorage <K, V> extends IInitializable {
      */
     has (key: K): boolean;
 
-    /**
-     * @param args
-     */
-    initialize (...args: any[]): void;
-
     /**
      * @param storage
      * @param mergeId

+ 1 - 1
src/types/TObject.d.ts

@@ -1,3 +1,3 @@
 /* tslint:disable:interface-over-type-literal */
 
-export type TObject <T = any> = {[key: string]: T};
+export type TObject <T = unknown> = {[key: string]: T};

+ 1 - 1
tslint.json

@@ -135,7 +135,7 @@
     "no-unnecessary-class": [true, "allow-static-only"],
     "no-unnecessary-initializer": true,
     "no-unnecessary-field-initialization": true,
-    "no-unnecessary-local-variable": true,
+    "no-unnecessary-local-variable": false,
     "no-unexpected-multiline": true,
     "no-unsafe-any": false,
     "no-unsafe-finally": true,

+ 9 - 9
yarn.lock

@@ -1458,11 +1458,11 @@ [email protected], combined-stream@~1.0.5:
   dependencies:
     delayed-stream "~1.0.0"
 
[email protected], commander@^2.12.1, commander@^2.8.1:
[email protected], commander@^2.8.1:
   version "2.15.1"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
 
[email protected]:
[email protected], commander@^2.12.1:
   version "2.16.0"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50"
 
@@ -4325,11 +4325,11 @@ [email protected]:
     source-map-support "^0.5.6"
     yn "^2.0.0"
 
[email protected], tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
[email protected], tslib@^1.7.1, tslib@^1.8.1:
   version "1.9.0"
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
 
[email protected]:
[email protected], tslib@^1.8.0:
   version "1.9.3"
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
 
@@ -4393,8 +4393,8 @@ tsutils@^2.12.1:
     tslib "^1.8.1"
 
 tsutils@^2.27.2:
-  version "2.28.0"
-  resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1"
+  version "2.29.0"
+  resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
   dependencies:
     tslib "^1.8.1"
 
@@ -4426,9 +4426,9 @@ typedarray@^0.0.6:
   version "0.0.6"
   resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
 
-typescript@2.9.2:
-  version "2.9.2"
-  resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
+typescript@3.0.1:
+  version "3.0.1"
+  resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"
 
 uglify-es@^3.3.4:
   version "3.3.9"