-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
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'));
plantain-00, BendingBender, aluanhaddad, phiresky and jsamr
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this