Give an error on using '--module' with a non-module input file #9082
Labels
Breaking Change
Would introduce errors in existing code
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Currently, if a user doesn't have an import/export statement, output usually messed up and users are left wondering how to fix them. We should give an error on using '--module' with a non-module input file.
Then give users an option like
--allowScriptInputs
or--allowGlobalInputs
if they really know what they're doing.One thing to keep in mind is that you don't want to create errors in the file itself, as it would be incredibly annoying to constantly see this error while typing. I would think you would only see it at emit time.
The text was updated successfully, but these errors were encountered: