From 0659ddca429da57326e2856c92bf51dfbad29dc2 Mon Sep 17 00:00:00 2001 From: Ray Solomon Date: Wed, 19 Aug 2015 10:10:20 -0700 Subject: [PATCH] bunyan: fix ts1202 errors when targeting es6 Before this change: ``` [ray@localhost DefinitelyTyped]$ tsc --noImplicitAny bunyan/bunyan-test.ts --module commonjs --target es6 bunyan/bunyan-test.ts(3,1): error TS1202: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead. bunyan/bunyan.d.ts(9,5): error TS1202: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead. [ray@localhost DefinitelyTyped]$ ``` After this change: ``` [ray@localhost DefinitelyTyped]$ tsc --noImplicitAny bunyan/bunyan-test.ts --module commonjs --target es6 [ray@localhost DefinitelyTyped]$ ``` --- bunyan/bunyan-test.ts | 2 +- bunyan/bunyan.d.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bunyan/bunyan-test.ts b/bunyan/bunyan-test.ts index b8e51d1451..c10c6c6e0b 100644 --- a/bunyan/bunyan-test.ts +++ b/bunyan/bunyan-test.ts @@ -1,6 +1,6 @@ /// -import bunyan = require('bunyan'); +import * as bunyan from 'bunyan'; var ringBufferOptions:bunyan.RingBufferOptions = { limit: 100 diff --git a/bunyan/bunyan.d.ts b/bunyan/bunyan.d.ts index 1f73705c33..e491b8cd34 100644 --- a/bunyan/bunyan.d.ts +++ b/bunyan/bunyan.d.ts @@ -6,9 +6,7 @@ /// declare module "bunyan" { - import events = require('events'); - import EventEmitter = events.EventEmitter; - import WritableStream = NodeJS.WritableStream; + import { EventEmitter } from 'events'; class Logger extends EventEmitter { constructor(options:LoggerOptions); @@ -52,7 +50,7 @@ declare module "bunyan" { name: string; streams?: Stream[]; level?: string | number; - stream?: WritableStream; + stream?: NodeJS.WritableStream; serializers?: Serializers; src?: boolean; } @@ -65,7 +63,7 @@ declare module "bunyan" { type?: string; level?: number | string; path?: string; - stream?: WritableStream | Stream; + stream?: NodeJS.WritableStream | Stream; closeOnExit?: boolean; }