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

@ts-check complains about a require of a JSON file. #21262

Closed
egamma opened this issue Jan 18, 2018 · 2 comments
Closed

@ts-check complains about a require of a JSON file. #21262

egamma opened this issue Jan 18, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@egamma
Copy link
Member

egamma commented Jan 18, 2018

The node require can also read in .json files.

In the following code the require is flagged with an error when the ´test.json´ file exists, but the code executes correctly.

//@ts-check
let test = require("./test.json")

image

@mhegazy
Copy link
Contributor

mhegazy commented Jan 18, 2018

Today the compiler does not recognize json files, neither in terms of resolution/lookup nor in terms of content. The suggestion is tracked by #7071

We have a fix for that in #13665, it is a bit stale now, so I do not have a concrete ETA at the moment.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Jan 18, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants