Skip to content

Care about esnext where we look for es2015#18331

Merged
weswigham merged 2 commits into
microsoft:masterfrom
weswigham:es2015-errors-are-esnext-errors
Sep 9, 2017
Merged

Care about esnext where we look for es2015#18331
weswigham merged 2 commits into
microsoft:masterfrom
weswigham:es2015-errors-are-esnext-errors

Conversation

@weswigham

Copy link
Copy Markdown
Member

Adds checks for ModuleKind.ESNext where we check for ModuleKind.ES2015, where appropriate.
Fixes #17556.

For tests, I reused our some of our module kind es2015 tests (which I also moved, hence the path changes), but targeting esnext instead.

==== tests/cases/conformance/externalModules/esnext/esnextmodulekindWithES5Target10.ts (3 errors) ====
import i = require("mod"); // Error;
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1202: Import assignment cannot be used when targeting ECMAScript 2015 modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the error message should be ECMAScript 2015 modules or later

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just went with the more generic ECMAScript modules.

@weswigham weswigham merged commit eb80799 into microsoft:master Sep 9, 2017
@weswigham weswigham deleted the es2015-errors-are-esnext-errors branch September 9, 2017 23:30
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants