Closed
Description
TypeScript Version: 2.4.2 / nightly (2.5.0-dev.20170801)
Code
import isUrl = require('is-url')
console.log(isUrl('http://www.foo.bar'))
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": true
}
}
Expected behavior:
Not entirely sure what is expected to happen here:
"module": "commonjs"
emitsvar isUrl = require("is-url");
"module": "es2015"
errors withindex.ts(1,1): error TS1202: Import assignment cannot be used when targeting ECMAScript 2015 modules. Consider using 'im port * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
Actual behavior:
The compilation finishes without an error, but the import is missing in the output:
"use strict";
console.log(isUrl('http://www.foo.bar'));