Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report errors for module generation other than "commonjs" with --resolveJsonModule #25566

Merged
merged 2 commits into from
Jul 10, 2018

Conversation

sheetalkamat
Copy link
Member

Fixes #25517 by reporting error

@@ -2548,6 +2548,10 @@ namespace ts {
if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs) {
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
}
// Any emit other than common js is error
else if (options.module !== undefined && options.module !== ModuleKind.CommonJS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just use getEmitModuleKind instead?

@sheetalkamat sheetalkamat merged commit 527093c into master Jul 10, 2018
@sheetalkamat sheetalkamat deleted the nonCommonJsResolveJsonIsError branch July 10, 2018 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants