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

Add a tsconfig option to assume every .ts file is a module #27535

Closed
osyrisrblx opened this issue Oct 3, 2018 · 3 comments
Closed

Add a tsconfig option to assume every .ts file is a module #27535

osyrisrblx opened this issue Oct 3, 2018 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@osyrisrblx
Copy link

osyrisrblx commented Oct 3, 2018

Currently with TypeScript, if I create two files and put const foo = "bar"; in each, I will get the following error:

image

For the specific environment I'm using, this is not the case at runtime. I'd like to silence this error with a tsconfig.json option.

One current workaround is to put export {}; in all my files to instruct TypeScript that the file is a module, but I'd like to avoid doing so.

@osyrisrblx
Copy link
Author

@osyrisrblx osyrisrblx changed the title tsconfig option to assume every .ts file is a module Add a tsconfig option to assume every .ts file is a module Oct 3, 2018
@RyanCavanaugh
Copy link
Member

Duplicate of #18232

@RyanCavanaugh RyanCavanaugh marked this as a duplicate of #18232 Oct 3, 2018
@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 8, 2018
@osyrisrblx
Copy link
Author

osyrisrblx commented May 29, 2019

@RyanCavanaugh Any chance of a tsconfig.json option to force all files to be considered modules?

My project does not run in a standard environment and files never share scope. Having to put export {} at the top of every file is frustrating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants